diff --git a/CHANGELOG.md b/CHANGELOG.md index 367286dc..f4b0a842 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.13.0] - Unreleased + +### Fixed +- Fix Import All not importing items that do not already exist when compileOnImport is not set (#798) + ## [2.12.2] - 2025-07-08 ### Fixed diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index b4786065..0fcae748 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 $$$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) + } + } } }