Skip to content

Commit af1b42d

Browse files
authored
Merge pull request #799 from raymond-rebbeck/import-all-no-compile
Import items that don't already exist when compileOnImport is not set
2 parents fc9a131 + b99d24d commit af1b42d

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.13.0] - Unreleased
9+
10+
### Fixed
11+
- Fix Import All not importing items that do not already exist when compileOnImport is not set (#798)
12+
813
## [2.12.2] - 2025-07-08
914

1015
### Fixed

cls/SourceControl/Git/Utils.cls

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,20 +1578,27 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As
15781578
set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(internalName)
15791579
continue:context.Package'=refPackage
15801580
set doImport = ..IsRoutineOutdated(internalName) || force
1581-
if ..IsInSourceControl(internalName) {
1582-
set sc = ..ImportItem(internalName, force)
1583-
} else {
1581+
if '..IsInSourceControl(internalName) {
15841582
set sc = ..AddToServerSideSourceControl(internalName)
1583+
if $$$ISERR(sc) {
1584+
set ec = $$$ADDSC(ec, sc)
1585+
}
15851586
}
1586-
if $$$ISERR(sc) {
1587-
set ec = $$$ADDSC(ec, sc)
1588-
}
1589-
if doImport && settings.compileOnImport {
1590-
set modification = ##class(SourceControl.Git.Modification).%New()
1591-
set modification.changeType = "M"
1592-
set modification.internalName = internalName
1593-
set modification.externalName = ..ExternalName(internalName)
1594-
set files($increment(files)) = modification
1587+
if doImport {
1588+
// If compiling then allow the pull event handler to import
1589+
if (settings.compileOnImport) {
1590+
set modification = ##class(SourceControl.Git.Modification).%New()
1591+
set modification.changeType = "M"
1592+
set modification.internalName = internalName
1593+
set modification.externalName = ..ExternalName(internalName)
1594+
set files($increment(files)) = modification
1595+
} else {
1596+
// If not compiling then import now as otherwise it won't happen
1597+
set sc = ..ImportItem(internalName, force)
1598+
if $$$ISERR(sc) {
1599+
set ec = $$$ADDSC(ec, sc)
1600+
}
1601+
}
15951602
}
15961603
}
15971604

0 commit comments

Comments
 (0)