Created
August 5, 2013 21:56
-
-
Save andrewshatnyy/6159964 to your computer and use it in GitHub Desktop.
Mercurial find old branches merged into default oldbranches.sh username
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
#!/bin/bash | |
USERNAME=$1 | |
get_heads () { | |
hg heads --template "{branches}:{author}\n" | |
} | |
find_user_branches () { | |
get_heads | grep -i "$USERNAME" | |
} | |
get_branch_names () { | |
find_user_branches | cut -d ":" -f 1 | |
} | |
compare_branches() { | |
for branch in `get_branch_names` | |
do | |
diff=`hg diff -r$branch:default` | |
if [ -z "$diff" ]; then | |
echo $branch | |
fi | |
done | |
} | |
main () { | |
compare_branches | |
} | |
echo "Working please wait..." | |
main | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment