@@ -770,7 +770,7 @@ ClassMethod AddToServerSideSourceControl(InternalName As %String) As %Status
770
770
#dim i as %Integer
771
771
#dim ec as %Status = $$$OK
772
772
for i = 1 :1 :$length (InternalName , " ," ) {
773
- #dim item as %String = .. NormalizeExtension ($piece (InternalName , " ," , i ))
773
+ #dim item as %String = ##class ( %Studio.SourceControl.Interface ). normalizeName ($piece (InternalName , " ," , i ))
774
774
if (item = " " ) {
775
775
continue
776
776
}
@@ -786,7 +786,7 @@ ClassMethod AddToSourceControl(InternalName As %String, refreshUncommitted As %B
786
786
#dim i as %Integer
787
787
#dim ec as %Status = $$$OK
788
788
for i = 1 :1 :$length (InternalName , " ," ) {
789
- #dim item as %String = .. NormalizeExtension ($piece (InternalName , " ," , i ))
789
+ #dim item as %String = ##class ( %Studio.SourceControl.Interface ). normalizeName ($piece (InternalName , " ," , i ))
790
790
#dim type as %String = ..Type (.item )
791
791
792
792
#dim sc as %Status = ..ExportItem (item ,,1 ,.filenames )
@@ -796,7 +796,7 @@ ClassMethod AddToSourceControl(InternalName As %String, refreshUncommitted As %B
796
796
797
797
for i =1 :1 :$Get (filenames ) {
798
798
set ignoreNonexistent = (type '= " ptd" )
799
- set FileInternalName = ##class (SourceControl.Git.Utils ). NormalizeExtension (
799
+ set FileInternalName = ##class (%Studio. SourceControl.Interface ). normalizeName (
800
800
##class (SourceControl.Git.Utils ).NameToInternalName (filenames (i ), 0 ,ignoreNonexistent ,1 ))
801
801
if (FileInternalName = " " ) {
802
802
continue
@@ -976,7 +976,7 @@ ClassMethod RemoveFromServerSideSourceControl(InternalName As %String) As %Statu
976
976
#dim i as %Integer
977
977
#dim ec as %Status = $$$OK
978
978
for i = 1 :1 :$length (InternalName , " ," ) {
979
- #dim item as %String = .. NormalizeExtension ($piece (InternalName , " ," , i ))
979
+ #dim item as %String = ##class ( %Studio.SourceControl.Interface ). normalizeName ($piece (InternalName , " ," , i ))
980
980
#dim tsc as %Status = $$$OK
981
981
#dim type as %String = ..Type (.InternalName )
982
982
@@ -1004,8 +1004,8 @@ ClassMethod RemoveFromSourceControl(InternalName As %String, cascadeDelete As %B
1004
1004
#dim type as %String = ..Type (.InternalName )
1005
1005
1006
1006
set item = $piece (InternalName , " ," , i )
1007
- if $data (@..#Storage@(" items" , .. NormalizeExtension (item ))) {
1008
- set item = .. NormalizeExtension (item )
1007
+ if $data (@..#Storage@(" items" , ##class ( %Studio.SourceControl.Interface ). normalizeName (item ))) {
1008
+ set item = ##class ( %Studio.SourceControl.Interface ). normalizeName (item )
1009
1009
}
1010
1010
1011
1011
if $data (@..#Storage@(" items" , item )) {
@@ -1207,21 +1207,21 @@ ClassMethod IsInSourceControl(InternalName As %String, ByRef sourceControlItem A
1207
1207
{
1208
1208
#dim isInSourceControl as %Boolean = 1
1209
1209
set sourceControlItem = " "
1210
- set InternalName = ##class (SourceControl.Git.Utils ). NormalizeExtension (InternalName )
1210
+ set InternalName = ##class (%Studio. SourceControl.Interface ). normalizeName (InternalName )
1211
1211
if (InternalName = " " ) {
1212
1212
quit 0
1213
1213
}
1214
1214
1215
1215
set context = ##class (SourceControl.Git.PackageManagerContext ).%Get ()
1216
- if $data (@..#Storage@(" items" , .. NormalizeExtension (InternalName ))) {
1217
- set InternalName = .. NormalizeExtension (InternalName )
1216
+ if $data (@..#Storage@(" items" , ##class ( %Studio.SourceControl.Interface ). normalizeName (InternalName ))) {
1217
+ set InternalName = ##class ( %Studio.SourceControl.Interface ). normalizeName (InternalName )
1218
1218
}
1219
1219
1220
1220
set isInSourceControl = $data (@..#Storage@(" items" , InternalName )) > 0
1221
1221
if isInSourceControl {
1222
1222
// Direct reference to namespace-default project
1223
1223
set sourceControlItem = InternalName
1224
- } elseif context .IsInGitEnabledPackage && (InternalName = .. NormalizeExtension (context .InternalName )) {
1224
+ } elseif context .IsInGitEnabledPackage && (InternalName = ##class ( %Studio.SourceControl.Interface ). normalizeName (context .InternalName )) {
1225
1225
// Next thing to check is if we're in a package manager-based package
1226
1226
set isInSourceControl = 1
1227
1227
set sourceControlItem = context .ResourceReference .Name
@@ -1278,7 +1278,7 @@ ClassMethod NormalizeInternalName(ByRef name As %String, Output fromWebApp As %B
1278
1278
set type = ..Type (.name )
1279
1279
1280
1280
if ($extract (name ) '= " /" ) && (type '=" csp" ) {
1281
- quit $piece ( name , " . " , 1 ,*- 1 )_ " . " _ $zconvert ( $piece ( name , " . " ,*), " U " )
1281
+ quit ##class ( %Studio.SourceControl.Interface ). normalizeName ( name )
1282
1282
}
1283
1283
1284
1284
if (name [ " /" ) && (type = " csp" ) {
@@ -1297,20 +1297,11 @@ ClassMethod NormalizeInternalName(ByRef name As %String, Output fromWebApp As %B
1297
1297
quit name
1298
1298
}
1299
1299
1300
- ClassMethod NormalizeExtension (name As %String ) As %String
1301
- {
1302
- #dim extension = $piece (name , " ." , $length (name , " ." ))
1303
- if $length (extension ) <= 3 {
1304
- set $piece (name , " ." , $length (name , " ." )) = $zconvert (extension , " L" )
1305
- }
1306
- quit name
1307
- }
1308
-
1309
1300
ClassMethod RoutineTSH (InternalName As %String ) As %String
1310
1301
{
1311
1302
#dim type = ..Type (InternalName )
1312
1303
//for csp-files (csp,js,html,css, all that stored in csp/...) we always check for changes in external file
1313
- #dim tsh = $case (type ," csp" :" " ,:$get (@..#Storage@(" TSH" , .. NormalizeExtension (InternalName ))))
1304
+ #dim tsh = $case (type ," csp" :" " ,:$get (@..#Storage@(" TSH" , ##class ( %Studio.SourceControl.Interface ). normalizeName (InternalName ))))
1314
1305
1315
1306
// in case an OS level error is returned
1316
1307
set :(($$$isUNIX & (tsh = -2 )) || ($$$isWINDOWS & (tsh = -3 ))) tsh = 0
@@ -1329,13 +1320,13 @@ ClassMethod RoutineTSH(InternalName As %String) As %String
1329
1320
1330
1321
ClassMethod UpdateRoutineTSH (InternalName As %String , tsh As %String ) As %Status
1331
1322
{
1332
- set @..#Storage@(" TSH" , .. NormalizeExtension (InternalName )) = $get (tsh , $h )
1323
+ set @..#Storage@(" TSH" , ##class ( %Studio.SourceControl.Interface ). normalizeName (InternalName )) = $get (tsh , $h )
1333
1324
quit $$$OK
1334
1325
}
1335
1326
1336
1327
ClassMethod RemoveRoutineTSH (InternalName As %String ) As %Status
1337
1328
{
1338
- kill @..#Storage@(" TSH" , .. NormalizeExtension (InternalName ))
1329
+ kill @..#Storage@(" TSH" , ##class ( %Studio.SourceControl.Interface ). normalizeName (InternalName ))
1339
1330
quit $$$OK
1340
1331
}
1341
1332
@@ -2280,12 +2271,14 @@ ClassMethod GitStatus(ByRef files, IncludeAllFiles = 0)
2280
2271
set list = $listfromstring (lines , $char (0 ))
2281
2272
set pointer = 0
2282
2273
while $listnext (list , pointer , item ) {
2283
- set operation = $zstrip ($extract (item , 1 , 2 ), " <W" )
2274
+ set operation = $zstrip ($extract (item , 1 , 2 ), " <> W" )
2284
2275
set externalName = $extract (item , 4 , *)
2285
2276
set internalName = ..NameToInternalName (externalName ,,0 )
2286
2277
if (internalName '= " " ) {
2287
2278
set files (internalName ) = $listbuild (operation , externalName )
2288
- set @..#Storage@(" items" ,..NormalizeInternalName (internalName )) = " "
2279
+ if (operation '= " D" ) {
2280
+ set @..#Storage@(" items" ,..NormalizeInternalName (internalName )) = " "
2281
+ }
2289
2282
} elseif ((IncludeAllFiles ) && (externalName '= " " )) {
2290
2283
set externalName = $TRANSLATE (externalName , " \" , " /" )
2291
2284
set files ($I (files )) = $listbuild (operation , externalName )
@@ -2407,8 +2400,8 @@ ClassMethod Name(InternalName As %String, ByRef MappingExists As %Boolean) As %S
2407
2400
2408
2401
if InternalName [" /" {
2409
2402
// If no specific mapping was specified (p=""), then return the whole csp filename; otherwise return the name without the mapped piece
2410
- set InternalName =$extract (InternalName ,$length (p )+2 ,*)
2411
- quit $translate (found _$translate (InternalName ," %" ," _" )," \" ," /" )
2403
+ set relativeInternalName =$extract (InternalName ,$length (p )+2 ,*)
2404
+ quit $translate (found _$translate (relativeInternalName ," %" ," _" )," \" ," /" )
2412
2405
} elseif (..Type (InternalName ) = " ptd" ) {
2413
2406
do ##class (SourceControl.Git.Production ).ParseInternalName (InternalName ,'default ,.filename )
2414
2407
return $translate (found _filename , " \" ," /" )
0 commit comments