Skip to content

Commit 9cd6308

Browse files
committed
new branch option in basic mode comes from default merge branch
1 parent 1b3401b commit 9cd6308

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Now skips files belonging to other git enabled packages in `##class(SourceControl.Git.Change).RefreshUncommitted()` (#347)
1818
- Added a new "Branch" parameter to `##class(SourceControl.Git.PullEventHandler)` (#351)
1919
- Command-line utility to do a baseline export of items in a namespace
20+
- 'New Branch' menu option in basic now will create new branches from the configured default merge branch
21+
- Merging back with the default merge branch is now a part of the basic mode's Sync flow
2022

2123

2224
## [2.3.1] - 2024-04-30

cls/SourceControl/Git/Extension.cls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
125125
set Enabled = $CASE(name,
126126
"Status": 1,
127127
"GitWebUI" : 1,
128+
"NewBranch": 1,
128129
"Sync": 1,
129130
"": 1,
130131
:-1

cls/SourceControl/Git/Utils.cls

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,16 @@ ClassMethod Commit(InternalName As %String, Message As %String = "example commit
340340

341341
ClassMethod NewBranch(newBranchName As %String) As %Status
342342
{
343+
set settings = ##class(SourceControl.Git.Settings).%New()
344+
if (settings.basicMode) && (settings.defaultMergeBranch '= ""){
345+
do ..RunGitWithArgs(.errStream, .outStream, "checkout", settings.defaultMergeBranch)
346+
do ..PrintStreams(errStream, outStream)
347+
kill errStream, outStream
348+
do ..RunGitWithArgs(.errStream, .outStream, "pull")
349+
do ..PrintStreams(errStream, outStream)
350+
kill errStream, outStream
351+
}
352+
343353
do ..RunGitWithArgs(.errStream, .outStream, "checkout", "-b", newBranchName)
344354
do ..PrintStreams(errStream, outStream)
345355
quit $$$OK

0 commit comments

Comments
 (0)