Skip to content

Commit 311ae8b

Browse files
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.
1 parent 573c292 commit 311ae8b

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

cls/SourceControl/Git/Utils.cls

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

0 commit comments

Comments
 (0)