Skip to content

Commit fcfa282

Browse files
committed
fix: remove instance-wide uncommitted check for decomposed production class
minor performance improvement in instance-wide uncommitted check fixed lock warning when uncommited check is disabled
1 parent 2e6a1a2 commit fcfa282

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Fixed
1414
- Fixed errors on production page when item settings need to be XML escaped (#667)
15+
- No longer display instance-wide uncommitted warning with decomposed production (#547)
1516

1617
## [2.8.0] - 2024-12-06
1718

cls/SourceControl/Git/Change.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ Query InstanceUncommitted() As %Query(ROWSPEC = "InternalName:%String,User:%Stri
202202

203203
ClassMethod InstanceUncommittedExecute(ByRef qHandle As %Binary) As %Status
204204
{
205-
set qHandle("q") = "SELECT InternalName, ChangedBy FROM SourceControl_Git.Change"
205+
set initNS = $namespace
206206
&sql(DECLARE InstanceCursor CURSOR FOR SELECT InternalName, ChangedBy into :internalName, :changedBy from SourceControl_Git.Change)
207207
set namespaces = ##class(SourceControl.Git.Utils).GetGitEnabledNamespaces()
208208
set tPtr = 0
209209
set qHandle("i") = 1
210210
new $namespace
211211
while $LISTNEXT(namespaces, tPtr, tValue) {
212212
set namespace = $ZCONVERT(tValue, "U")
213-
if '(namespace [ "^") {
213+
if '(namespace [ "^") && (namespace '= initNS) {
214214
set $NAMESPACE = namespace
215215

216216
&sql(OPEN InstanceCursor)

cls/SourceControl/Git/Extension.cls

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@ Method UserAction(Type As %Integer, Name As %String, InternalName As %String, Se
5656
}
5757

5858
if (Type = 1) && (Name = 3) {
59-
if settings.warnInstanceWideUncommitted {
60-
// if item is being edited in a different namespace, opening it will display an alert. Editing in this namespace will remove the alert.
61-
set filename = ##class(SourceControl.Git.Utils).FullExternalName(.InternalName)
62-
do ##class(SourceControl.Git.Change).GetUncommitted(filename,.tAction)
63-
do ..GetStatus(.InternalName, .isInSourceControl, .isEditable,.isCheckedOut,.userCheckedOut)
64-
if '$data(tAction) {
65-
set user = "", inNamespace = ""
66-
if 'isEditable || ##class(SourceControl.Git.Utils).Locked() {
67-
set Target = "Warning: Attempting to edit read-only file"
68-
write !, Target
69-
set Action = 6
70-
} elseif ##class(SourceControl.Git.Utils).InstanceWideUncommittedCheck(InternalName, .user, .inNamespace) {
71-
set Target = "Warning: Item " _ InternalName _ " is currently being modified by " _ user _ " in namespace " _ inNamespace _ "."
72-
write !, Target
73-
set Action = 6
74-
}
75-
}
59+
set filename = ##class(SourceControl.Git.Utils).FullExternalName(.InternalName)
60+
do ##class(SourceControl.Git.Change).GetUncommitted(filename,.tAction)
61+
do ..GetStatus(.InternalName, .isInSourceControl, .isEditable,.isCheckedOut,.userCheckedOut)
62+
if '$data(tAction) {
63+
set user = "", inNamespace = ""
64+
if 'isEditable || ##class(SourceControl.Git.Utils).Locked() {
65+
set Target = "Warning: Attempting to edit read-only file"
66+
write !, Target
67+
set Action = 6
68+
} elseif settings.warnInstanceWideUncommitted
69+
&& ##class(SourceControl.Git.Utils).InstanceWideUncommittedCheck(InternalName, .user, .inNamespace)
70+
&& '(##class(SourceControl.Git.Utils).ItemIsProductionToDecompose(InternalName)) {
71+
// if item is being edited in a different namespace, opening it will display an alert. Editing in this namespace will remove the alert.
72+
set Target = "Warning: Item " _ InternalName _ " is currently being modified by " _ user _ " in namespace " _ inNamespace _ "."
73+
write !, Target
74+
set Action = 6
75+
}
7676
}
7777
}
7878

0 commit comments

Comments
 (0)