I wrote a simple script that completes closing a branch, the commands found in PruningDeadBranches .
## script ##
#!/bin/bash #script to close not required branch in mercurial hg up -C $1 if [ $? -eq 0 ]; then echo "$1 is up" else echo "branch not found, please recheck your argument" exit 1 fi echo "$1 is up" hg commit --close-branch -m 'this branch no longer required' echo "$1 is closed" hg up -C default echo "default is up"
how
Navigate to the local copy of the repository and run this script by providing an argument. For example:
$./the_script_above.sh bad_branch_name_to_close
What is he doing
This does the following:
- If a branch exists, it is updated to this branch or exists with an error message.
- He closes the branch.
- Default branch updates.
- Stop.
Roshan Poudyal Aug 18 '15 at 5:19 2015-08-18 05:19
source share