Skip to content

Commit c6e7c5e

Browse files
committed
Merge branch 'main' of https://github.com/intersystems/git-source-control into production-change-control
2 parents ad30a5e + 2ee0280 commit c6e7c5e

File tree

5 files changed

+33
-12
lines changed

5 files changed

+33
-12
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [2.8.0] - 2024-11-04
8+
## [2.8.0] - Unreleased
99

1010
### Added
1111
- Production Decomposition mode allows controlling interoperability productions as individual files for each host (#469)
1212

13+
## [2.7.1] - Unreleased
14+
15+
### Fixed
16+
- Fixed improper encoding of unicode characters in commit messages (#627)
17+
- Creating a new branch now reports the error if uncommitted changes conflict (#624)
18+
- Fix Configure erroring out if git isn't found (#632)
19+
- Fix "%" replacing characters in lookup table names (#588)
20+
1321
## [2.7.0] - 2024-11-04
1422

1523
### Added

cls/SourceControl/Git/API.cls

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ ClassMethod Configure()
1818
set gitExists = ##class(SourceControl.Git.Utils).GitBinExists(.version)
1919
set gitBinPath = ##class(SourceControl.Git.Utils).GitBinPath(.isDefault)
2020

21-
// Make sure they are using an appropriate git version
22-
if (+$PIECE(version,"version ",2))<2.31 {
23-
write !!, "WARNING: You are using an older version of git which is not compatible with git-source-control. Please upgrade to git version 2.31.0 or greater to continue"
24-
write !!, "Cancelling git-source-control configuration..."
25-
quit
26-
}
2721
if gitExists && isDefault {
2822
// Note: version starts with "git version"
2923
write !,version," is available via PATH. You may enter a path to a different version if needed."

cls/SourceControl/Git/Settings.cls

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ ClassMethod Configure() As %Boolean [ CodeMode = objectgenerator ]
273273
do %code.WriteLine(" set status = inst.ConfigureBinPath(.value)")
274274
do %code.WriteLine(" if (status) { set valid = 1 }")
275275
do %code.WriteLine(" }")
276+
do %code.WriteLine(" set gitExists = ##class(SourceControl.Git.Utils).GitBinExists(.version)")
277+
do %code.WriteLine(" if (+$PIECE(version,""version "",2))<2.31 && gitExists{")
278+
do %code.WriteLine(" write !!, ""WARNING: You are using an older version of git which is not compatible with git-source-control. Please upgrade to git version 2.31.0 or greater to continue""")
279+
do %code.WriteLine(" write !!, ""Cancelling git-source-control configuration...""")
280+
do %code.WriteLine(" quit")
281+
do %code.WriteLine(" }")
276282
} elseif ((propertyDef) && (propertyDef.Name = "basicMode")) {
277283
set basicModePromptFlag = defaultPromptFlag + $$$MatchExactArrayMask + $$$InitialDisplayMask
278284
do %code.WriteLine(" set list(1) = ""Yes""")

cls/SourceControl/Git/Utils.cls

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ClassMethod TempFolder() As %String
4949

5050
ClassMethod DefaultTempFolder() As %String
5151
{
52-
quit $get(@..#Storage@("settings","namespaceTemp"),..DefaultTemp()_$translate($znspace,"%")_..#Slash)
52+
quit $get(@..#Storage@("settings","namespaceTemp"),..DefaultTemp()_..#Slash_$translate($znspace,"%")_..#Slash)
5353
}
5454

5555
ClassMethod MappingsNode() As %String [ CodeMode = expression ]
@@ -406,11 +406,17 @@ ClassMethod NewBranch(newBranchName As %String) As %Status
406406
{
407407
set settings = ##class(SourceControl.Git.Settings).%New()
408408
if (settings.basicMode) && (settings.defaultMergeBranch '= ""){
409-
do ..RunGitWithArgs(.errStream, .outStream, "checkout", settings.defaultMergeBranch)
409+
set err = ..RunGitWithArgs(.errStream, .outStream, "checkout", settings.defaultMergeBranch)
410410
do ..PrintStreams(errStream, outStream)
411+
if (err) {
412+
quit $$$ERROR($$$GeneralError,errStream.Read()_$c(10)_"Current branch is: "_..GetCurrentBranch())
413+
}
411414
kill errStream, outStream
412-
do ..RunGitWithArgs(.errStream, .outStream, "pull")
415+
set err = ..RunGitWithArgs(.errStream, .outStream, "pull")
413416
do ..PrintStreams(errStream, outStream)
417+
if (err) {
418+
quit $$$ERROR($$$GeneralError,errStream.Read()_$c(10)_"Current branch is: "_..GetCurrentBranch())
419+
}
414420
kill errStream, outStream
415421
}
416422

@@ -2574,7 +2580,9 @@ ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, V
25742580
if (InternalName="") {
25752581
//take our best guess based on the document extension mapped to that subdirectory
25762582
set nam=$piece(nam,".",1,*-1)
2577-
set nam=$replace(nam, ..PercentClassReplace(), "%")
2583+
if ((fileExt = "cls") || (fileExt = "rtn") || (fileExt = "inc")) {
2584+
set nam=$replace(nam, ..PercentClassReplace(), "%")
2585+
}
25782586
set nam=$translate(nam,"/",".")
25792587
set InternalName=nam_"."_fileExt
25802588
if (fileExt="cls") {

cls/SourceControl/Git/WebUIDriver.cls

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,12 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
244244
}
245245
set handled = 1
246246
} elseif (pathStart = "git-command") {
247-
set requestBody = ##class(%Library.DynamicObject).%FromJSON(%request.Content)
247+
set stringBody = ""
248+
while '%request.Content.AtEnd {
249+
set stringBody = stringBody _ %request.Content.Read()
250+
}
251+
set stringBody = $zconvert(stringBody,"I","UTF8")
252+
set requestBody = ##class(%Library.DynamicObject).%FromJSON(stringBody)
248253
set command = requestBody.command
249254

250255
set gitCmd = command.%Get(0)

0 commit comments

Comments
 (0)