Skip to content

Commit d366208

Browse files
committed
fix (Export All): If a tracked item no longer exists in the namespace, remove internal tracking (#821)
- Allows "Export all" to proceed and complete correctly.
1 parent cbcdc5b commit d366208

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Import All now imports configuration file before everything else (#806)
1717
- Fixed another instance of deletes showing as owned by undefined user (#812)
1818
- Fix Revert not syncing files with IRIS (#789)
19+
- Fix "Export All" stopping prematurely because a tracked item no longer exist in the namespace (#821)
1920

2021
## [2.12.2] - 2025-07-08
2122

cls/SourceControl/Git/Utils.cls

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)