@@ -254,33 +254,33 @@ ClassMethod Revert(InternalName As %String) As %Status
254
254
quit $$$OK
255
255
}
256
256
257
- ClassMethod NewBranch ( newBranchName As %String ) As %Status
257
+ ClassMethod Commit ( InternalName As %String , Message As %String = " example commit message " ) As %Status
258
258
{
259
- do ..RunGitWithArgs (.errStream , .outStream , " checkout" , " -b" , newBranchName )
260
- do errStream .OutputToDevice ()
259
+ set filename = ..FullExternalName (InternalName )
260
+ set username = ..GitUserName ()
261
+ set email = ..GitUserEmail ()
262
+ set author = username _" <" _email _" >"
263
+ do ..RunGitWithArgs (.errStream , .outStream , " commit" , " --author" , author , " -m" , Message , filename )
264
+ write !
261
265
do outStream .OutputToDevice ()
266
+ write !
267
+ do errStream .OutputToDevice ()
262
268
quit $$$OK
263
269
}
264
270
265
- ClassMethod SwitchBranch ( targetBranchName As %String ) As %Status
271
+ ClassMethod NewBranch ( newBranchName As %String ) As %Status
266
272
{
267
- do ..RunGitWithArgs (.errStream , .outStream , " checkout" , targetBranchName )
273
+ do ..RunGitWithArgs (.errStream , .outStream , " checkout" , " -b " , newBranchName )
268
274
do errStream .OutputToDevice ()
269
275
do outStream .OutputToDevice ()
270
276
quit $$$OK
271
277
}
272
278
273
- ClassMethod Commit ( InternalName As %String , Message As %String = " example commit message " ) As %Status
279
+ ClassMethod SwitchBranch ( targetBranchName As %String ) As %Status
274
280
{
275
- set filename = ..FullExternalName (InternalName )
276
- set username = ..GitUserName ()
277
- set email = ..GitUserEmail ()
278
- set author = username _" <" _email _" >"
279
- do ..RunGitWithArgs (.errStream , .outStream , " commit" , " --author" , author , " -m" , Message , filename )
280
- write !
281
- do outStream .OutputToDevice ()
282
- write !
281
+ do ..RunGitWithArgs (.errStream , .outStream , " checkout" , targetBranchName )
283
282
do errStream .OutputToDevice ()
283
+ do outStream .OutputToDevice ()
284
284
quit $$$OK
285
285
}
286
286
@@ -386,14 +386,17 @@ ClassMethod AddToSourceControl(InternalName As %String) As %Status
386
386
for i = 1 :1 :$length (InternalName , " ," ) {
387
387
#dim item as %String = ..NormalizeExtension ($piece (InternalName , " ," , i ))
388
388
set @..#Storage@(" items" , item ) = " "
389
- #dim sc as %Status = ..ExportItem (item )
389
+ #dim sc as %Status = ..ExportItem (item ,,,. filenames )
390
390
if 'sc {
391
391
set ec = $$$ADDSC(ec , sc )
392
392
}
393
- // Necessary for items in new folders
394
- do ..RunGitCommand (" add" ,.errStream ,.outStream ,..ExternalName (InternalName ))
395
- do outStream .OutputToDevice ()
396
- do errStream .OutputToDevice ()
393
+ #dim extension = $piece (item , " ." , $length (item , " ." ))
394
+
395
+ for i =1 :1 :filenames {
396
+ do ..RunGitCommand (" add" ,.errStream ,.outStream ,filenames (i ))
397
+ do outStream .OutputToDevice ()
398
+ do errStream .OutputToDevice ()
399
+ }
397
400
}
398
401
set ec = $$$ADDSC(ec , ..ExportSCList ())
399
402
quit ec
@@ -448,7 +451,7 @@ ClassMethod RemoveFromSourceControl(InternalName As %String) As %Status
448
451
} else {
449
452
#dim parentElement as %String = " "
450
453
if ..IsInSourceControl (item , .parentElement ) {
451
- set tsc = ..MakeError (item _ " is contained in " _parentElement _" that tracked by SourceControl" )
454
+ set tsc = ..MakeError (item _ " is contained in " _parentElement _" that tracked is by SourceControl" )
452
455
}else {
453
456
set tsc = ..MakeError (item _ " is not in SourceControl" )
454
457
}
@@ -918,7 +921,7 @@ ClassMethod ImportRoutines(force As %Boolean = 0) As %Status
918
921
quit ec
919
922
}
920
923
921
- ClassMethod ExportRoutinesAux (path As %String , sep As %String = " " , level As %Integer = 0 , force As %Boolean = 0 ) As %Status
924
+ ClassMethod ExportRoutinesAux (path As %String , sep As %String = " " , level As %Integer = 0 , force As %Boolean = 0 , ByRef filenames ) As %Status
922
925
{
923
926
#define Dir
924
927
#define OrderBy
@@ -941,32 +944,33 @@ ClassMethod ExportRoutinesAux(path As %String, sep As %String = "", level As %In
941
944
942
945
if (type = $$$Directory) || (type = $$$CSPFolder) {
943
946
#dim newpath as %String = $case (path ," " :name ,:path _isdirectory _name )
944
- do ..ExportRoutinesAux (newpath , isdirectory , level + 1 , force )
947
+ do ..ExportRoutinesAux (newpath , isdirectory , level + 1 , force , . filenames )
945
948
} else {
946
949
#dim InternalName as %String = path _sep _name
947
950
if (type = $$$CspFile) && ($extract (InternalName ) '= " /" ) {
948
951
set InternalName = " /" _InternalName
949
952
}
950
- set ec = ..ExportItem (InternalName , 1 , force )
953
+ set ec = ..ExportItem (InternalName , 1 , force , . filenames )
951
954
}
952
955
}
953
956
kill rs
954
957
quit ec
955
958
}
956
959
957
- ClassMethod ExportItem (InternalName As %String , expand As %Boolean = 1 , force As %Boolean = 0 ) As %Status
960
+ ClassMethod ExportItem (InternalName As %String , expand As %Boolean = 1 , force As %Boolean = 0 , ByRef filenames ) As %Status
958
961
{
959
962
#dim type = ..Type (InternalName )
960
963
if type = " pkg" {
961
- $$$QuitOnError(..ExportRoutinesAux (..NameWithoutExtension (InternalName ), " ." , 0 , force ))
964
+ $$$QuitOnError(..ExportRoutinesAux (..NameWithoutExtension (InternalName ), " ." , 0 , force , . filenames ))
962
965
}elseif type = " prj" && expand {
963
- $$$QuitOnError(..ExportProject (..NameWithoutExtension (InternalName ), force ))
964
- $$$QuitOnError(..ExportItem (InternalName , 0 , force ))
966
+ $$$QuitOnError(..ExportProject (..NameWithoutExtension (InternalName ), force , . filenames ))
967
+ $$$QuitOnError(..ExportItem (InternalName , 0 , force , . filenames ))
965
968
}elseif (type = " csp" ) && ..IsCspFolder (InternalName ) {
966
- $$$QuitOnError(..ExportRoutinesAux (InternalName , " /" , 0 , force ))
969
+ $$$QuitOnError(..ExportRoutinesAux (InternalName , " /" , 0 , force , . filenames ))
967
970
}else {
968
971
if ..IsTempFileOutdated (InternalName ) || force {
969
972
#dim filename as %String = ..FullExternalName (InternalName )
973
+ set filenames ($I (filenames )) = filename
970
974
write " exporting new version of " , InternalName , " to " , filename ,!
971
975
$$$QuitOnError($system .OBJ .ExportUDL (InternalName , filename ," -d/diff" ))
972
976
$$$QuitOnError(..UpdateRoutineTSH (InternalName , $h ))
@@ -978,7 +982,7 @@ ClassMethod ExportItem(InternalName As %String, expand As %Boolean = 1, force As
978
982
quit $$$OK
979
983
}
980
984
981
- ClassMethod ExportProject (project As %String , force As %Boolean = 0 ) As %Status
985
+ ClassMethod ExportProject (project As %String , force As %Boolean = 0 , ByRef filenames ) As %Status
982
986
{
983
987
#dim rs as %ResultSet = ##class (%ResultSet ).%New (" %Studio.Project:ProjectItemsList" )
984
988
$$$QuitOnError(rs .Execute (project ))
@@ -988,7 +992,7 @@ ClassMethod ExportProject(project As %String, force As %Boolean = 0) As %Status
988
992
if $listfind (typesWithoutExtension , rs .Get (" Type" )) {
989
993
set name = name _ " ." _ rs .Get (" Type" )
990
994
}
991
- #dim ec as %Status = ..ExportItem (name , 1 , force )
995
+ #dim ec as %Status = ..ExportItem (name , 1 , force , . filenames )
992
996
quit :'ec
993
997
}
994
998
kill rs
0 commit comments