From 663c28e28b886f2f36866e6b64ef3d1cae7ea80c 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 | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) 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) + } + } } } From b99d24d703092601c002987192d4b999f45f4b4d 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 | 5 +++++ 1 file changed, 5 insertions(+) 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