@@ -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