@@ -30,61 +30,62 @@ Storage Default
3030/// </ul>
3131ClassMethod RemoveUncommitted (FileList , Display = 1 , Revert = 0 , ActiveCommit = 1 , CommitCCR ) As %Status
3232{
33- If ' $DATA (FileList ) Quit $$$ERROR($$$GeneralError," No filenames were passed" )
34- Set filename =FileList ,SCs =$$$OK
35- If $DATA (FileList )>1 Set filename =$ORDER (FileList (" " ))
36- While (filename '=" " ) {
37- If Display Write !,filename _" removed from uncommitted list"
38- If '..IsUncommitted (filename ) Set filename =$ORDER (FileList (filename )) continue
39- Set obj =..OpenUncommitted (filename )
40- If (obj .Source =" trakcare" )&&($D (^SYS (" ChangeControlClass" ))) {
41- Set changeSourceClass =^SYS (" ChangeControlClass" )
42- } Else {
43- Set changeSourceClass =##class (%Studio.SourceControl.Interface ).SourceControlClassGet ()
44- }
45- If ('$G (^SYS (" SourceControl" ," ChangeConfig" ," KeepHistory" )))||(Revert ) {
46- Set sc =..%DeleteId (obj .%Id ())
47- } Else {
48- If $G (CommitCCR )'=" " Set obj .CCR =CommitCCR
49- Set obj .P4Issued =$zdt ( $H ,3 )
50- Set obj .Committed =1
51- Set obj .ActivelyCommitted =ActiveCommit
52- Set obj .CommittedTime =$zdt ( $H ,3 )
53- Set sc =obj .%Save ()
54- If $$$ISERR(sc ) Do $SYSTEM .Status .AppendStatus (SCs , sc ) If Display Do $System .Status .DisplayError (sc )
55- }
56- Set filename =$ORDER (FileList (filename ))
57- }
58- Quit SCs
33+ if ' $data (FileList ) quit $$$ERROR($$$GeneralError," No filenames were passed" )
34+ set filename =FileList ,SCs =$$$OK
35+ if $data (FileList )>1 set filename =$order (FileList (" " ))
36+ while (filename '=" " ) {
37+ if Display write !,filename _" removed from uncommitted list"
38+ if '..IsUncommitted (filename ) set filename =$order (FileList (filename )) continue
39+ set obj =..OpenUncommitted (filename )
40+ if (obj .Source =" trakcare" )&&($data (^SYS (" ChangeControlClass" ))) {
41+ set changeSourceClass =^SYS (" ChangeControlClass" )
42+ } else {
43+ set changeSourceClass =##class (%Studio.SourceControl.Interface ).SourceControlClassGet ()
44+ }
45+ if ('$get (^SYS (" SourceControl" ," ChangeConfig" ," KeepHistory" )))||(Revert ) {
46+ set sc =..%DeleteId (obj .%Id ())
47+ } else {
48+ if $get (CommitCCR )'=" " set obj .CCR =CommitCCR
49+ set obj .P4Issued =$zdatetime ( $h ,3 )
50+ set obj .Committed =1
51+ set obj .ActivelyCommitted =ActiveCommit
52+ set obj .CommittedTime =$zdatetime ( $h ,3 )
53+ set sc =obj .%Save ()
54+ if $$$ISERR(sc ) do $system .Status .AppendStatus (SCs , sc ) if Display do $system .Status .DisplayError (sc )
55+ }
56+ set filename =$order (FileList (filename ))
57+ }
58+ quit SCs
5959}
6060
6161ClassMethod IsUncommitted (Filename , ByRef ID ) As %Boolean
6262{
63- &sql (SELECT ID into :ID FROM SourceControl_Git .Change WHERE ItemFile = :Filename AND Committed = ' 0' )
64- If (SQLCODE =0 ) {
65- Quit 1
66- } Else {
67- Set ID =" "
68- Quit 0
69- }
63+ & SQL (SELECT ID INTO :ID FROM SourceControl _Git .Change WHERE ItemFile = :Filename AND Committed = '0 ')
64+ if (SQLCODE =0 ) {
65+ quit 1
66+ } else {
67+ set ID =" "
68+ quit 0
69+ }
7070}
7171
7272/// Goes through Uncommitted queue and removes any items of action 'edit' or 'add' which are ReadOnly or non-existent on the filesystem
7373ClassMethod RefreshUncommitted (Display = 1 , IncludeRevert = 0 ) As %Status
7474{
75- Set sc =..ListUncommitted (.tFileList ,IncludeRevert ,0 )
76- If $$$ISERR(sc ) Quit sc
77- Set filename =" " , filename =$ORDER (tFileList (filename ),1 ,action )
78- While (filename '=" " ) {
79- Set examine =$Select (action =" add" :1 ,action =" edit" :1 ,IncludeRevert &&(action =" revert" ):1 ,1 :0 )
80- If 'examine Set filename =$ORDER (tFileList (filename ),1 ,action ) continue
81- If ('##class (%File ).Exists (filename )) {
82- Set sc =..RemoveUncommitted (filename ,Display ,0 ,0 )
83- If $$$ISERR(sc ) s filename =" " continue
84- }
85- Set filename =$ORDER (tFileList (filename ),1 ,action )
86- }
87- Quit sc
75+ set sc =..ListUncommitted (.tFileList ,IncludeRevert ,0 )
76+ if $$$ISERR(sc ) quit sc
77+ set filename =" " , filename =$order (tFileList (filename ),1 ,action )
78+ while (filename '=" " ) {
79+ set examine =$select (action =" add" :1 ,action =" edit" :1 ,IncludeRevert &&(action =" revert" ):1 ,1 :0 )
80+ if 'examine set filename =$order (tFileList (filename ),1 ,action ) continue
81+ if ('##class (%File ).Exists (filename )) {
82+ set sc =..RemoveUncommitted (filename ,Display ,0 ,0 )
83+ if $$$ISERR(sc ) set filename =" " continue
84+ }
85+ set filename =$order (tFileList (filename ),1 ,action )
86+ }
87+ quit sc
8888}
8989
9090}
91+
0 commit comments