Skip to content

Commit e781f1d

Browse files
authored
Merge branch 'main' into feature/add-xslts-to-baseline
2 parents dbda7ac + d6007c1 commit e781f1d

File tree

6 files changed

+63
-9
lines changed

6 files changed

+63
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

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

1620
## [2.12.2] - 2025-07-08
1721

1822
### Fixed
1923
- Fixed importing Lookup Tables that do not already exist (#791)
20-
- Fix initial import of settings file that has yet to be imported (#794)
24+
- Fixed initial import of settings file that has yet to be imported (#794)
2125
- Fixed syncing IRIS with files after pull to diff in the intended direction (#802)
2226

2327
## [2.12.1] - 2025-06-27

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ We encourage use of [Conventional Commits](https://www.conventionalcommits.org/e
1414

1515
Generally speaking, just try to match the conventions you see in the code you are reading. For this project, these include:
1616

17-
* Do not use shortened command and function names - e.g., `s` instead of `set`, `$p` instead of `$piece`
17+
* Do not use shortened command and function names. For example, use `set` instead of `s` instead of `set` and `$piece` instead of `$p`
1818
* One command per line
1919
* Do not use dot syntax
2020
* Indentation with tabs
21-
* Pascal case class and method names
21+
* [Pascal case](https://en.wikipedia.org/wiki/Camel_case) class and method names
2222
* Avoid using postconditionals
2323
* Local variables start with `t`; formal parameter names start with `p`
2424
* Always check %Status return values

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: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)