-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test with branch as parameter. Default branch name is default
Bash with dash was working but there were no test for branch name with dash It seems that bat was also working. Odd.
- Loading branch information
Showing
6 changed files
with
56 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build: off | ||
|
||
test_script: | ||
- test\hg\bat\test-incoming.bat | ||
- test\hg\bat\test-incoming.bat | ||
- test\hg\bat\test-incoming.bat branch-with-dash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
if [ -z $2 ]; then | ||
echo "ERROR: Branch name not given. Cannot create branch without name." | ||
exit 1 | ||
fi | ||
|
||
CURRENT=$(hg branch) | ||
|
||
if [ "$CURRENT" = "$1" ]; then | ||
echo "WARN: Already in given branch." | ||
fi | ||
|
||
hg -R $1 branch $2 | ||
hg -R $1 push -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
IF [%2] == [] GOTO BranchNotSet | ||
|
||
|
||
for /f %%i in ('hg -R %1 branch') do set current=%%i | ||
|
||
if [%2] == [%current%] GOTO Ready | ||
|
||
hg -R %1 branch %2 | ||
hg -R %1 push -f | ||
GOTO Ready | ||
|
||
|
||
:BranchNotSet | ||
echo "ERROR: Cannot change branch if it is not defined" | ||
exit 1 | ||
|
||
:Ready | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters