diff --git a/CHANGELOG.md b/CHANGELOG.md index b309a450..34d02d0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Partial support for production decomposition with the new interoperability editors ### Fixed +- Changing system mode (environment name) in setting spersists after instance restart (#655) - Popping from stash is more responsive (#687) - Favorites links for Git pages now works on recent IRIS versions (#734) diff --git a/cls/SourceControl/Git/Settings.cls b/cls/SourceControl/Git/Settings.cls index 02aa8bf4..d70a2f81 100644 --- a/cls/SourceControl/Git/Settings.cls +++ b/cls/SourceControl/Git/Settings.cls @@ -159,7 +159,7 @@ Method %Save() As %Status set @storage@("settings", "user", $username, "basicMode") = ..basicMode } try { - do $SYSTEM.Version.SystemMode(..environmentName) + do ##class(%zpkg.isc.sc.git.SystemMode).SetSystemMode(..environmentName) } catch e { // no-op; user might not have privileges. } diff --git a/cls/_zpkg/isc/sc/git/SystemMode.cls b/cls/_zpkg/isc/sc/git/SystemMode.cls new file mode 100644 index 00000000..54ca3951 --- /dev/null +++ b/cls/_zpkg/isc/sc/git/SystemMode.cls @@ -0,0 +1,23 @@ +Class %zpkg.isc.sc.git.SystemMode +{ + ClassMethod SetEnvironment(environment As %String) As %Status [ NotInheritable, Private ] +{ + $$$AddAllRoleTemporary + do $SYSTEM.Version.SystemMode(environment) + new $namespace + set $namespace = "%SYS" + set obj = ##class(Config.Startup).Open() + set obj.SystemMode = environment + return obj.%Save() +} + +ClassMethod SetSystemMode(environment As %String) As %Status [ NotInheritable ] +{ + try { + do ..SetEnvironment(environment) + } catch e { + return e.AsStatus() + } + return $$$OK +} +} \ No newline at end of file diff --git a/module.xml b/module.xml index 14518da8..3ae81b72 100644 --- a/module.xml +++ b/module.xml @@ -3,7 +3,7 @@ git-source-control - 2.10.0 + 2.11.0 Server-side source control extension for use of Git on InterSystems platforms git source control studio vscode module