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 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) + } + } } }