@@ -74,9 +74,13 @@ Method AfterUserAction(Type As %Integer, Name As %String, InternalName As %Strin
74
74
if menu '= " %SourceMenu" , menu '=" %SourceContext" {
75
75
quit $$$OK
76
76
}
77
- set InternalName = ##class (SourceControl.Git.Utils ).NormalizeInternalName (InternalName )
77
+ set InternalName = ##class (SourceControl.Git.Utils ).NormalizeInternalName (InternalName , . fromWebApp )
78
78
set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
79
79
set ec = ##class (SourceControl.Git.Utils ).AfterUserAction (Type , Name , InternalName , .Answer , .Msg , .Reload )
80
+ if fromWebApp {
81
+ // Force reload and compile of actual item if underlying file has changed
82
+ do ..OnBeforeLoad (InternalName ,1 ,1 )
83
+ }
80
84
quit ec
81
85
}
82
86
@@ -234,12 +238,12 @@ Method OnMenuItem(MenuName As %String, InternalName As %String, SelectedText As
234
238
235
239
/// This is called before the actual load of data to give the chance
236
240
/// to load the item from an external format.
237
- Method OnBeforeLoad (InternalName As %String , verbose As %Boolean ) As %Status
241
+ Method OnBeforeLoad (InternalName As %String , verbose As %Boolean , compile As %Boolean = 0 ) As %Status
238
242
{
239
243
set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
240
244
set InternalName = ##class (SourceControl.Git.Utils ).NormalizeInternalName (InternalName )
241
245
if ##class (SourceControl.Git.Utils ).IsInSourceControl (InternalName ) {
242
- quit ##class (SourceControl.Git.Utils ).ImportItem (InternalName ,,0 )
246
+ quit ##class (SourceControl.Git.Utils ).ImportItem (InternalName ,,0 , compile )
243
247
}
244
248
quit $$$OK
245
249
}
@@ -273,14 +277,21 @@ Method OnAfterSave(InternalName As %String, Object As %RegisteredObject = {$$$NU
273
277
{
274
278
set sc = $$$OK
275
279
try {
276
- set InternalName = ##class (SourceControl.Git.Utils ).NormalizeInternalName (.InternalName )
280
+ set InternalName = ##class (SourceControl.Git.Utils ).NormalizeInternalName (.InternalName ,. fromWebApp ,. fullExternalName )
277
281
set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
278
282
if ##class (SourceControl.Git.Utils ).IsNamespaceInGit () && ..IsInSourceControl (InternalName ) {
279
- set filename = ##class (SourceControl.Git.Utils ).FullExternalName (InternalName )
280
- $$$ThrowOnError(##class (SourceControl.Git.Utils ).RemoveRoutineTSH (InternalName ))
281
- $$$ThrowOnError(##class (SourceControl.Git.Utils ).ExportItem (InternalName ))
282
- if '##class (SourceControl.Git.Change ).IsUncommitted (filename ) {
283
- $$$ThrowOnError(##class (SourceControl.Git.Change ).SetUncommitted (filename , " edit" , InternalName , $username , " " , 1 , " " , " " , 0 ))
283
+ if fromWebApp {
284
+ if fullExternalName = ##class (SourceControl.Git.Utils ).FullExternalName (InternalName ) {
285
+ // Reimport item into database
286
+ $$$ThrowOnError(##class (SourceControl.Git.Utils ).ImportItem (InternalName ,,1 ,1 ))
287
+ }
288
+ } else {
289
+ set filename = ##class (SourceControl.Git.Utils ).FullExternalName (InternalName )
290
+ $$$ThrowOnError(##class (SourceControl.Git.Utils ).RemoveRoutineTSH (InternalName ))
291
+ $$$ThrowOnError(##class (SourceControl.Git.Utils ).ExportItem (InternalName ))
292
+ if '##class (SourceControl.Git.Change ).IsUncommitted (filename ) {
293
+ $$$ThrowOnError(##class (SourceControl.Git.Change ).SetUncommitted (filename , " edit" , InternalName , $username , " " , 1 , " " , " " , 0 ))
294
+ }
284
295
}
285
296
}
286
297
} catch e {
0 commit comments