Skip to content

Commit 80920f9

Browse files
authored
Merge branch 'main' into feature/update-progress-messages
2 parents 146599e + dfe5d77 commit 80920f9

File tree

5 files changed

+59
-6
lines changed

5 files changed

+59
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111
- Fix Import All not importing items that do not already exist when compileOnImport is not set (#798)
12-
- Fix baselining output more consistent, human readable
12+
- Fix baselining output more consistent, human readable (#814)
13+
- Import All now imports configuration file before everything else (#806)
14+
- Fixed another instance of deletes showing as owned by undefined user (#812)
15+
- Fix Revert not syncing files with IRIS (#789)
1316

1417
## [2.12.2] - 2025-07-08
1518

cls/SourceControl/Git/Change.cls

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ ClassMethod AddDeletedToUncommitted(Filename, InternalName) As %Status
6666
Quit ..SetUncommitted(Filename, "delete", InternalName, $USERNAME, "", 1, "", "", 0)
6767
}
6868

69+
/// Determine if an item is deleted, if it is not in a provided list of git files but is a known tracked item
70+
ClassMethod IsDeleted(InternalName As %String, ByRef gitFiles) As %Boolean
71+
{
72+
Quit ('$data(gitFiles(InternalName))) && ($data($$$TrackedItems(##class(%Studio.SourceControl.Interface).normalizeName(InternalName))))
73+
}
74+
6975
/// The Filename here is an ExternalName formatted name with the full file path
7076
ClassMethod IsUncommitted(Filename, ByRef ID) As %Boolean
7177
{
@@ -151,8 +157,7 @@ ClassMethod RefreshUncommitted(Display = 0, IncludeRevert = 0, Output gitFiles,
151157

152158
if ((InternalName = "")
153159
|| ((InternalName '= "")
154-
&& ('$data(gitFiles(InternalName), found))
155-
&& ($data($$$TrackedItems(##class(%Studio.SourceControl.Interface).normalizeName(InternalName)))))) {
160+
&& ..IsDeleted(InternalName, .gitFiles))) {
156161
set sc=..RemoveUncommitted(filename,Display,0,0)
157162
if $$$ISERR(sc) continue
158163
}

cls/SourceControl/Git/Extension.cls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ Method GetStatus(ByRef InternalName As %String, ByRef IsInSourceControl As %Bool
529529
} else {
530530
// If it doesn't show up in git status, there are no uncommitted changes so it should not be locked or checked out by any user
531531
set Editable=1, IsCheckedOut=0, UserCheckedOut=""
532-
if ##class(SourceControl.Git.Change).IsUncommitted(filename){
532+
if ##class(SourceControl.Git.Change).IsUncommitted(filename)
533+
&& '##class(SourceControl.Git.Change).IsDeleted(InternalName, .files) {
533534
#; Remove the item from the list of uncommitted changes;
534535
set sc=##class(SourceControl.Git.Change).RemoveUncommitted(filename,1,1)
535536
if $$$ISERR(sc) write "Error removing uncommitted file "_filename_" - "_$system.OBJ.DisplayError(sc)

cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@ Method OnPull() As %Status
1515
for i=1:1:$get(..ModifiedFiles) {
1616
set internalName = ..ModifiedFiles(i).internalName
1717
if internalName = ##class(SourceControl.Git.Settings.Document).#INTERNALNAME {
18-
set sc = $$$ADDSC(sc, ##class(SourceControl.Git.Utils).ImportItem(internalName))
18+
set sc = $$$ADDSC(sc, ##class(SourceControl.Git.Utils).ImportItem(internalName, 1))
19+
quit
1920
}
2021
}
2122

2223
set nFiles = 0
2324

2425
for i=1:1:$get(..ModifiedFiles){
2526
set internalName = ..ModifiedFiles(i).internalName
27+
28+
// Don't import the config file a second time
29+
continue:internalName=##class(SourceControl.Git.Settings.Document).#INTERNALNAME
30+
2631
if ((internalName = "") && (..ModifiedFiles(i).changeType '= "D")) {
2732
write !, ..ModifiedFiles(i).externalName, " was not imported into the database and will not be compiled. "
2833
} elseif (..ModifiedFiles(i).changeType = "D") {

cls/SourceControl/Git/Utils.cls

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)