@@ -982,6 +982,7 @@ ClassMethod RemoveFromServerSideSourceControl(InternalName As %String) As %Statu
982982
983983 if $data (@..#Storage@(" items" , item )) {
984984 kill @..#Storage@(" items" , item )
985+ do ..RemoveRoutineTSH (item )
985986 do ..RemoveFolderIfEmpty (..TempFolder ())
986987 } elseif (type = " cls" ) {
987988 set tsc = ..MakeError (item _ " is not in SourceControl" )
@@ -1567,7 +1568,7 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As
15671568
15681569 #dim ec as %Status = ..ListItemsInFiles (.itemList , .err )
15691570 quit :'ec ec
1570-
1571+
15711572 // If there is a config file it must be imported before everything else.
15721573 if $Data (itemList (##class (SourceControl.Git.Settings.Document ).#INTERNALNAME)) {
15731574 set sc = ##class (SourceControl.Git.Utils ).ImportItem (##class (SourceControl.Git.Settings.Document ).#INTERNALNAME, force )
@@ -1591,10 +1592,10 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As
15911592 for {
15921593 set internalName = $order (itemList (internalName ))
15931594 quit :internalName =" "
1594-
1595+
15951596 // Don't import the config file a second time
15961597 continue :internalName =##class (SourceControl.Git.Settings.Document ).#INTERNALNAME
1597-
1598+
15981599 set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (internalName )
15991600 continue :context .Package '=refPackage
16001601 set doImport = ..IsRoutineOutdated (internalName ) || force
@@ -1720,7 +1721,11 @@ ClassMethod ExportItem(InternalName As %String, expand As %Boolean = 1, force As
17201721 write !, " Production decomposition enabled, skipping export of production class"
17211722 set filename = " "
17221723 } else {
1723- $$$QuitOnError($system .OBJ .ExportUDL (InternalName , filename ," -d/diff" ))
1724+ set tSC = $SYSTEM .OBJ .ExportUDL (InternalName , filename ," -d/diff" )
1725+ if $$$ISERR(tSC ) {
1726+ write !?5 , InternalName , " not found. Cleaning up source control."
1727+ do ..RemoveFromServerSideSourceControl (InternalName )
1728+ }
17241729 }
17251730 if (filename '= " " ) && ##class (%File ).Exists (filename ) {
17261731 set filenames ($I (filenames )) = filename
0 commit comments