Skip to content

Commit d2eaff4

Browse files
committed
Merge branch 'main' of https://github.com/intersystems/git-source-control into fix-branch-names
2 parents ef73200 + ee80d7f commit d2eaff4

7 files changed

Lines changed: 110 additions & 50 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- Import of decomposed production items now has a brief timeout in case another deploy is in progress (#949)
1212
- Option to view an individual file's history in the source control menu (#960)
13+
- Change context menu now lists IPM packages from all Git-enabled namespaces, prefixed with the namespace name (#952)
1314

1415
### Fixed
1516
- Changes to % routines mapped to the current namespace may now be added to source control and committed (#944)
1617
- Edits to a decomposed production in VS Code fixed after changes to the VS Code ObjectScript extension (#949)
18+
- Configure prompt no longer quits out with an unhelpful error if existing boolean settings are null (#962)
1719
- Branch names are now constrained to a reasonable set of allowed characters, fixing an issue where branch names with special characters were hidden without explanation (#914)
1820

1921
## [2.16.0] - 2026-03-06

cls/SourceControl/Git/Settings.cls

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ ClassMethod CreateNamespaceTempFolder() As %Status [ Internal ]
280280
return $$$OK
281281
}
282282

283-
ClassMethod Configure() As %Boolean [ CodeMode = objectgenerator, Internal ]
283+
ClassMethod Configure(Output sc As %Status = {$$$OK}) As %Boolean [ CodeMode = objectgenerator, Internal ]
284284
{
285285
do %code.WriteLine(" set inst = ..%New()")
286286
do %code.WriteLine(" do inst.RetrieveDefaults()")
@@ -305,6 +305,7 @@ ClassMethod Configure() As %Boolean [ CodeMode = objectgenerator, Internal ]
305305
set promptQuoted = $replace(promptQuoted,"${username}","'""_$Username_""'")
306306
set propertyDef = ##class(%Dictionary.PropertyDefinition).%OpenId("SourceControl.Git.Settings||"_property_"")
307307
if ((propertyDef) && (propertyDef.Type = "%Boolean")) {
308+
do %code.WriteLine(" set value = ''value")
308309
do %code.WriteLine(" set response = ##class(%Library.Prompt).GetYesNo("_promptQuoted_",.value,,"_defaultPromptFlag_")")
309310
} elseif ((propertyDef) && (propertyDef.Name = "gitBinPath")) {
310311
do %code.WriteLine(" set valid = 0")
@@ -342,6 +343,7 @@ ClassMethod Configure() As %Boolean [ CodeMode = objectgenerator, Internal ]
342343
} else {
343344
do %code.WriteLine(" set response = ##class(%Library.Prompt).GetString("_promptQuoted_",.value,,,,"_defaultPromptFlag_")")
344345
}
346+
do %code.WriteLine(" if (response = $$$ErrorResponse) { set sc = $get(%objlasterror, 0) }")
345347
do %code.WriteLine(" if response '= $$$SuccessResponse { quit 0 }")
346348
do %code.WriteLine(" set value = $zstrip(value,""<>W"")")
347349
do %code.WriteLine(" set inst."_property_" = value")

cls/SourceControl/Git/Utils.cls

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,18 +2823,28 @@ ClassMethod GetContexts(onlyNamespaces As %Boolean) As %DynamicArray
28232823

28242824
set name = ""
28252825

2826-
// Using embedded for backwards compatability
2826+
// Using embedded instead of ExecDirectNoPriv() for backwards compatability
28272827
if '(onlyNamespaces) {
28282828
&sql(DECLARE C1 CURSOR FOR SELECT name into :name from %Library.RoutineMgr_StudioOpenDialog('*.ZPM'))
2829-
&sql(OPEN C1)
2830-
throw:SQLCODE<0 ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE, %msg)
2831-
&sql(FETCH C1)
2832-
while(SQLCODE = 0) {
2833-
set package = name
2834-
do contexts.%Push(package)
2835-
&sql(FETCH C1)
2829+
new $namespace
2830+
set ptr = 0
2831+
while $listnext(namespaces,ptr,ns) {
2832+
if '($FIND(ns,"^^")) {
2833+
try {
2834+
set $NAMESPACE = ns
2835+
&sql(OPEN C1)
2836+
throw:(SQLCODE<0) ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE, %msg)
2837+
&sql(FETCH C1)
2838+
while (SQLCODE = 0) {
2839+
do contexts.%Push(ns_":"_name)
2840+
&sql(FETCH C1)
2841+
}
2842+
&sql(CLOSE C1)
2843+
} catch e {
2844+
// skip inaccessible namespaces
2845+
}
2846+
}
28362847
}
2837-
&sql(CLOSE C1)
28382848
}
28392849

28402850
return contexts
@@ -3407,3 +3417,4 @@ ClassMethod IsSchemaStandard(pName As %String = "") As %Boolean [ Internal ]
34073417
}
34083418

34093419
}
3420+

git-webui/package-lock.json

Lines changed: 49 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,10 +752,11 @@ webui.SideBarView = function(mainView, noEventHandlers) {
752752
}
753753

754754
self.getCurrentContext = function() {
755+
// URL pattern here is like webuidriver.csp/<namespace>/<InternalName of selected item>
755756
var args = window.location.href.split("webuidriver.csp/")[1].split("?")[0].split("/");
756757
var context = args[0];
757758
if (args[1] && (args[1].indexOf(".ZPM") != -1)) {
758-
context = args[1];
759+
context = args[0] + ":" + args[1];
759760
}
760761
return context;
761762
}
@@ -765,7 +766,9 @@ webui.SideBarView = function(mainView, noEventHandlers) {
765766
var args = urlParts[1].split("?")[0].split("/");
766767
var querySuffix = window.location.search || "";
767768
if (context.indexOf(".ZPM") != -1) {
768-
args[1] = context;
769+
var parts = context.split(":");
770+
args[0] = parts[0];
771+
args[1] = parts[1];
769772
} else {
770773
args[0] = context;
771774
args[1] = "";

git-webui/src/share/git-webui/webui/js/git-webui.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,10 +752,11 @@ webui.SideBarView = function(mainView, noEventHandlers) {
752752
}
753753

754754
self.getCurrentContext = function() {
755+
// URL pattern here is like webuidriver.csp/<namespace>/<InternalName of selected item>
755756
var args = window.location.href.split("webuidriver.csp/")[1].split("?")[0].split("/");
756757
var context = args[0];
757758
if (args[1] && (args[1].indexOf(".ZPM") != -1)) {
758-
context = args[1];
759+
context = args[0] + ":" + args[1];
759760
}
760761
return context;
761762
}
@@ -765,7 +766,9 @@ webui.SideBarView = function(mainView, noEventHandlers) {
765766
var args = urlParts[1].split("?")[0].split("/");
766767
var querySuffix = window.location.search || "";
767768
if (context.indexOf(".ZPM") != -1) {
768-
args[1] = context;
769+
var parts = context.split(":");
770+
args[0] = parts[0];
771+
args[1] = parts[1];
769772
} else {
770773
args[0] = context;
771774
args[1] = "";

test/UnitTest/SourceControl/Git/Settings.cls

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,32 @@ Method TestSaveAndImportSettings()
107107
do $$$AssertEquals(^SYS("SourceControl","Git","settings","generatedFilesReadOnly"),"1")
108108
}
109109

110+
/// Configure routine should succeed when accepting all defaults.
111+
Method TestConfigureCHUI()
112+
{
113+
set oldRedirectIO = ##class(%Device).ReDirectIO()
114+
set oldIO = $io
115+
set st = $$$OK
116+
try {
117+
use $io::"^"_##class(%Studio.SourceControl.ItemSet).LogTags()
118+
do ##class(%Library.Device).ReDirectIO(1)
119+
set configRet = ##class(SourceControl.Git.Settings).Configure(.configSC)
120+
// test when a boolean setting is set with invalid value
121+
set ^SYS("SourceControl","Git","settings","generatedFilesReadOnly")=""
122+
set configWithInvalidRet = ##class(SourceControl.Git.Settings).Configure(.configWithInvalidSC)
123+
} catch err {
124+
set st = err.AsStatus()
125+
}
126+
use oldIO
127+
do ##class(%Device).ReDirectIO(oldRedirectIO)
128+
$$$ThrowOnError(st)
129+
do $$$AssertTrue(configRet)
130+
do $$$AssertStatusOK(configSC)
131+
do $$$AssertTrue(configWithInvalidRet)
132+
do $$$AssertStatusOK(configWithInvalidSC)
133+
do $$$AssertEquals($get(^SYS("SourceControl","Git","settings","generatedFilesReadOnly"),""), 0)
134+
}
135+
110136
Method OnBeforeAllTests() As %Status
111137
{
112138
merge ..SourceControlGlobal = ^SYS("SourceControl")

0 commit comments

Comments
 (0)