Skip to content

Instantly share code, notes, and snippets.

@gbrian
Created August 9, 2017 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbrian/e6e68ded9fe7d031a102f4b09de238cd to your computer and use it in GitHub Desktop.
Save gbrian/e6e68ded9fe7d031a102f4b09de238cd to your computer and use it in GitHub Desktop.
Create new mercurial branch associated to a trello card
@echo off
if "%1" == "" goto error
SET card=%1
For %%A in ("%card%") do (
Set Branch=%%~nxA
)
echo.Branch is: %Branch%
hg pull
echo "Update to release --clean"
hg update --clean release
echo "Create branch:%Branch%"
hg branch "%Branch%"
IF %ERRORLEVEL% NEQ 0 goto errorBranch
hg commit -m "%card%"
goto exit
:errorBranch
echo "Error creating branch"
echo
:error
echo "USAGE trellobranch trello_card_link
echo
echo
echo "Creates a branch based on the trello card"
echo "Example: trellobranch https://trello.com/c/7WJJJJJ/7-my-trello-card"
:exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment