@@ -1567,6 +1567,22 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As
15671567
15681568 #dim ec as %Status = ..ListItemsInFiles (.itemList , .err )
15691569 quit :'ec ec
1570+
1571+ // If there is a config file it must be imported before everything else.
1572+ if $Data (itemList (##class (SourceControl.Git.Settings.Document ).#INTERNALNAME)) {
1573+ set sc = ##class (SourceControl.Git.Utils ).ImportItem (##class (SourceControl.Git.Settings.Document ).#INTERNALNAME, force )
1574+
1575+ if $$$ISERR(sc ) {
1576+ set ec = $$$ADDSC(ec , sc )
1577+ } else {
1578+ kill err , itemList
1579+ set err = 0
1580+
1581+ // Get the item list again as it may be different after just importing the config file
1582+ set ec = $$$ADDSC(ec , ..ListItemsInFiles (.itemList , .err ))
1583+ }
1584+ quit :'ec ec
1585+ }
15701586
15711587 kill files
15721588
@@ -1575,6 +1591,10 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As
15751591 for {
15761592 set internalName = $order (itemList (internalName ))
15771593 quit :internalName =" "
1594+
1595+ // Don't import the config file a second time
1596+ continue :internalName =##class (SourceControl.Git.Settings.Document ).#INTERNALNAME
1597+
15781598 set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (internalName )
15791599 continue :context .Package '=refPackage
15801600 set doImport = ..IsRoutineOutdated (internalName ) || force
@@ -1684,13 +1704,13 @@ ClassMethod ExportItem(InternalName As %String, expand As %Boolean = 1, force As
16841704 if (type = " ptd" ) || ..IsTempFileOutdated (InternalName ) || force {
16851705 #dim filename as %String = ..FullExternalName (InternalName , .MappingExists )
16861706 if (MappingExists = 0 ){
1687- write " Did not find a matching mapping for " " " _InternalName _" " " . Skipping export."
1707+ write !, " Did not find a matching mapping for " " " _InternalName _" " " . Skipping export."
16881708 quit $$$OK
16891709 }
16901710
16911711 // Items mapped to namespace's non default routine database are ignored if set to be read-only
16921712 if (..FileIsMapped (InternalName ) && settings .mappedItemsReadOnly ) {
1693- write " Mapping to another database found. Skipping export"
1713+ write !, " Mapping to another database found. Skipping export"
16941714 quit $$$OK
16951715 }
16961716 write !, " exporting new version of " , InternalName , " to " , filename
@@ -1981,6 +2001,25 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
19812001 set diffCompare = args (i + 1 )
19822002 } elseif (args (i ) = " commit" ) {
19832003 set isCommit = 1
2004+ } elseif (args (i ) = " reset" ) {
2005+ // Sync files after performing a 'Hard Reset' via the WebUI
2006+ if (args (i + 1 ) = " --hard" ) {
2007+ set syncIrisWithDiff = 1
2008+ set syncIrisWithDiffAfterGit = 1
2009+ set syncIrisWithDiffVerbose = 1
2010+ // The current commit will still be able to be referenced to diff against
2011+ // despite the fact that it will disappear after the reset is performed
2012+ set diffBase = ..GetCurrentRevision ()
2013+ }
2014+ } elseif (args (i ) = " revert" ) {
2015+ // Sync files after performing a 'Revert' via the WebUI
2016+ if (args (i + 1 ) = " --no-commit" ) {
2017+ set syncIrisWithDiff = 1
2018+ set syncIrisWithDiffAfterGit = 1
2019+ set syncIrisWithDiffVerbose = 1
2020+ // When syncing diff against what is being reverted
2021+ set diffBase = args (i + 2 )
2022+ }
19842023 }
19852024 }
19862025 }
0 commit comments