@@ -41,6 +41,7 @@ Method UserAction(Type As %Integer, Name As %String, InternalName As %String, Se
41
41
quit $$$OK
42
42
}
43
43
set InternalName = ##class (Utils ).NormalizeInternalName (InternalName )
44
+ set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
44
45
set ec = ##class (Utils ).UserAction (InternalName , Name , .Target , .Action , .Reload )
45
46
quit ec
46
47
}
@@ -53,6 +54,7 @@ Method AfterUserAction(Type As %Integer, Name As %String, InternalName As %Strin
53
54
quit $$$OK
54
55
}
55
56
set InternalName = ##class (Utils ).NormalizeInternalName (InternalName )
57
+ set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
56
58
set ec = ##class (Utils ).AfterUserAction (Type , Name , InternalName , .Answer , .Msg , .Reload )
57
59
quit ec
58
60
}
@@ -133,7 +135,7 @@ Method OnSourceMenuContextItem(itemName As %String, menuItemName As %String, ByR
133
135
set Enabled = -1
134
136
} elseif $F (itemName ," ," ) > 0 { //if more than one item is selected, we can only add/remove, no diff or blame
135
137
set Enabled = $case (menuItemName ," %AddToSC" :1 ," %RemoveFromSC" :1 ,:-1 )
136
- } elseif ##class (Utils ).IsInSourceControl (##class ( Utils ). NormalizeInternalName ( itemName ) ) {
138
+ } elseif ##class (Utils ).IsInSourceControl (itemName ) {
137
139
set Enabled = $Case (menuItemName , " %AddToSC" :-1 ,:1 )
138
140
} else {
139
141
set Enabled = $Case (menuItemName , " %AddToSC" :1 ,:-1 )
@@ -148,6 +150,9 @@ Method OnSourceMenuContextItem(itemName As %String, menuItemName As %String, ByR
148
150
/// this menu item from the list totally, 0 will gray the menu item out and the default 1 will display the menu item as normal.
149
151
Method OnMenuItem (MenuName As %String , InternalName As %String , SelectedText As %String , ByRef Enabled As %Boolean , ByRef DisplayName As %String ) As %Status
150
152
{
153
+ set InternalName = ##class (Utils ).NormalizeInternalName (InternalName )
154
+ set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
155
+
151
156
#dim menu As %String = $Piece (MenuName ," ," )
152
157
#dim name As %String = $Piece (MenuName ," ," ,2 )
153
158
if menu = " %SourceContext" , name = " " {
@@ -170,6 +175,7 @@ Method OnMenuItem(MenuName As %String, InternalName As %String, SelectedText As
170
175
/// to load the item from an external format.
171
176
Method OnBeforeLoad (InternalName As %String ) As %Status
172
177
{
178
+ set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
173
179
set InternalName = ##class (Utils ).NormalizeInternalName (InternalName )
174
180
if ##class (Utils ).IsInSourceControl (InternalName ) {
175
181
quit ##class (Utils ).ImportItem (InternalName )
@@ -186,6 +192,7 @@ Method OnAfterSave(InternalName As %String, Object As %RegisteredObject = {$$$NU
186
192
set sc = $$$OK
187
193
try {
188
194
set InternalName = ##class (Utils ).NormalizeInternalName (InternalName )
195
+ set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
189
196
if ##class (Utils ).IsNamespaceInGit () && ..IsInSourceControl (InternalName ) {
190
197
set filename = ##class (Utils ).FullExternalName (InternalName )
191
198
$$$ThrowOnError(##class (Utils ).RemoveRoutineTSH (InternalName ))
@@ -216,6 +223,7 @@ InternalName'="" && ##class(Utils).IsInSourceControl(##class(Utils).NormalizeInt
216
223
/// Called after an item is deleted.
217
224
Method OnAfterDelete (InternalName As %String ) As %Status
218
225
{
226
+ set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
219
227
set InternalName = ##class (Utils ).NormalizeInternalName (InternalName )
220
228
if ##class (Utils ).IsInSourceControl (InternalName ) {
221
229
quit ##class (Utils ).DeleteExternalFile (InternalName )
@@ -240,7 +248,7 @@ Method IsReadOnly(InternalName As %String) As %Boolean
240
248
/// Check if another user has committed any changes to the item and return the status
241
249
Method GetStatus (InternalName As %String , ByRef IsInSourceControl As %Boolean , ByRef Editable As %Boolean , ByRef IsCheckedOut As %Boolean , ByRef UserCheckedOut As %String ) As %Status
242
250
{
243
- #; Quit ##super(InternalName,.IsInSourceControl,.Editable,.IsCheckedOut,.UserCheckedOut )
251
+ set context = ##class ( SourceControl.Git.PackageManagerContext ). ForInternalName ( InternalName )
244
252
set Editable ='..IsReadOnly (),IsCheckedOut =1 ,UserCheckedOut =" "
245
253
set filename =##class (SourceControl.Git.Utils ).FullExternalName (InternalName )
246
254
set IsInSourceControl =(filename '=" " &&($$$FileExists(filename )))
@@ -250,7 +258,7 @@ Method GetStatus(InternalName As %String, ByRef IsInSourceControl As %Boolean, B
250
258
if '$$$FileExists(filename ) {
251
259
set IsCheckedOut =0
252
260
}
253
- do ##class (Utils ).GitStatus (.files )
261
+ do ##class (SourceControl.Git. Utils ).GitStatus (.files )
254
262
if $Get (files (InternalName )) '= " " {
255
263
///it's in source control, checked out, and should be locked to editing by other users
256
264
///find out who has it edited
0 commit comments