@@ -1567,14 +1567,34 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As
15671567
15681568 #dim ec as %Status = ..ListItemsInFiles (.itemList , .err )
15691569 quit :'ec ec
1570-
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+ }
1586+
15711587 kill files
15721588
15731589 set settings = ##class (SourceControl.Git.Settings ).%New ()
15741590 #dim internalName as %String = " "
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
@@ -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