Skip to content

Commit ade4490

Browse files
committed
prevent overwrite server popup from showing up for every change
1 parent 3d38013 commit ade4490

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

cls/SourceControl/Git/Extension.cls

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,21 @@ Method OnBeforeLoad(InternalName As %String, verbose As %Boolean) As %Status
210210
/// Called before Studio checks for the timestamp of an item.
211211
Method OnBeforeTimestamp(InternalName As %String)
212212
{
213+
set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(InternalName)
214+
if $IsObject($Get(%request)) {
215+
set clientServerHash = ##class(%Atelier.REST).GetClientServerHash()
216+
if (clientServerHash '= "") {
217+
// suppress load / timestamp update if file on server was modified an extremely short time ago
218+
set file = ##class(SourceControl.Git.Utils).FullExternalName(InternalName)
219+
if (file '= "") {
220+
set lastModifiedTime = ##class(%Library.File).GetFileDateModified(file)
221+
set diff = $System.SQL.Functions.DATEDIFF("ms",lastModifiedTime,$h)
222+
if (diff < 1000) {
223+
quit
224+
}
225+
}
226+
}
227+
}
213228
quit ..OnBeforeLoad(InternalName,0)
214229
}
215230

@@ -346,4 +361,3 @@ Method AddToSourceControl(InternalName As %String, Description As %String = "")
346361
}
347362

348363
}
349-

0 commit comments

Comments
 (0)