From 5fb0ec8b658b095e006517a05030252746161448 Mon Sep 17 00:00:00 2001 From: Raymond Rebbeck Date: Fri, 27 Jun 2025 22:50:58 +0930 Subject: [PATCH 1/2] Fix Import All not importing anything that doesn't already exist when compileOnImport is not set For an item that is not already in source control, Import All would add it to source control and then if compileOnImport was set the default pull handler would be invoked, which would result in the item being imported too. However, when compileOnImport is not set the default pull handler would not be invoked, and the item would not be imported. This change makes it so that the item is imported when compileOnImport is not set. --- cls/SourceControl/Git/Utils.cls | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index 775aff1a..35df24f9 100644 --- a/cls/SourceControl/Git/Utils.cls +++ b/cls/SourceControl/Git/Utils.cls @@ -1578,20 +1578,27 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(internalName) continue:context.Package'=refPackage set doImport = ..IsRoutineOutdated(internalName) || force - if ..IsInSourceControl(internalName) { - set sc = ..ImportItem(internalName, force) - } else { + if '..IsInSourceControl(internalName) { set sc = ..AddToServerSideSourceControl(internalName) } if $$$ISERR(sc) { set ec = $$$ADDSC(ec, sc) } - if doImport && settings.compileOnImport { - set modification = ##class(SourceControl.Git.Modification).%New() - set modification.changeType = "M" - set modification.internalName = internalName - set modification.externalName = ..ExternalName(internalName) - set files($increment(files)) = modification + if doImport { + // If compiling then allow the pull event handler to import + if (settings.compileOnImport) { + set modification = ##class(SourceControl.Git.Modification).%New() + set modification.changeType = "M" + set modification.internalName = internalName + set modification.externalName = ..ExternalName(internalName) + set files($increment(files)) = modification + } else { + // If not compiling then import now as otherwise it won't happen + set sc = ..ImportItem(internalName, force) + if $$$ISERR(sc) { + set ec = $$$ADDSC(ec, sc) + } + } } } From 3ae97847a6a49970b99ac538ea6373e8848dc244 Mon Sep 17 00:00:00 2001 From: Raymond Rebbeck Date: Fri, 27 Jun 2025 23:10:56 +0930 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67c36176..0804ca31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed importing Lookup Tables that do not already exist (#791) +- Fix Import All not importing items that do not already exist when compileOnImport is not set (#798) ## [2.12.1] - 2025-06-27