Skip to content

Commit 344370c

Browse files
author
ksaduest
committed
updated logic and default setting for lockbranch
1 parent 7051a65 commit 344370c

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

cls/SourceControl/Git/Extension.cls

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Import SourceControl.Git
33
/// Main source control extension class, configured namespace-wide to enable use via VSCode and Studio
44
Class SourceControl.Git.Extension Extends %Studio.SourceControl.Base
55
{
6+
67
Parameter DOMAIN = "Studio";
78

89
XData Menu
@@ -181,16 +182,16 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
181182
}
182183

183184
set settings = ##class(SourceControl.Git.Settings).%New()
184-
if settings.lockBranch set BranchLocked = settings.lockBranch
185+
if settings.lockBranch = 1 {set BranchLocked = -1} else {set BranchLocked = 1}
185186

186187
if ##class(SourceControl.Git.Utils).BasicMode() {
187188
set Enabled = $CASE(name,
188189
"Status": 1,
189190
"GitWebUI" : 1,
190191
"Import": 1,
191192
"ImportForce": 1,
192-
"NewBranch": 1-BranchLocked,
193-
"SwitchBranch": 1-BranchLocked,
193+
"NewBranch": BranchLocked,
194+
"SwitchBranch": BranchLocked,
194195
"Sync": 1,
195196
"": 1,
196197
:-1
@@ -204,8 +205,8 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
204205
"ExportForce": 1,
205206
"Import": 1,
206207
"ImportForce": 1,
207-
"NewBranch": 1-BranchLocked,
208-
"SwitchBranch": 1-BranchLocked,
208+
"NewBranch": BranchLocked,
209+
"SwitchBranch": BranchLocked,
209210
"Push": 1,
210211
"PushForce": 1,
211212
"Fetch": 1,

cls/SourceControl/Git/Settings.cls

+1-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ Method RetrieveDefaults() As %Boolean
510510
Method SaveDefaults() As %Boolean
511511
{
512512
set defaults = {}
513-
set items = $lb("gitBinPath", "pullEventClass", "percentClassReplace", "environmentName", "systemBasicMode", "defaultMergeBranch", "mappedItemsReadOnly", "compileOnImport", "lockBranch")
513+
set items = $lb("gitBinPath", "pullEventClass", "percentClassReplace", "environmentName", "systemBasicMode", "defaultMergeBranch", "mappedItemsReadOnly", "compileOnImport")
514514
for i=1:1:$LISTLENGTH(items) {
515515
set property = $listget(items,i)
516516
do defaults.%Set(property, $property($this, property))

cls/SourceControl/Git/Utils.cls

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ ClassMethod EnvironmentName() As %String
187187

188188
ClassMethod LockBranch() As %Boolean
189189
{
190-
quit $get(@..#Storage@("settings","lockBranch"),1)
190+
quit $get(@..#Storage@("settings","lockBranch"),0)
191191
}
192192

193193
ClassMethod IsLIVE() As %Boolean

csp/gitprojectsettings.csp

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ body {
2222
text-align: left;
2323
}
2424

25+
2526
.btn-add {
2627
border:none;
2728
padding:0%;

0 commit comments

Comments
 (0)