Skip to content

Commit 663c28e

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 fc9a131 commit 663c28e

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

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)