Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Script to capture the branches that have incoming changes and dump them in a file to be used later. This doesn't detect changes in the default branch, so the last couple of lines should take care of that if you need this.
# This command can seem confusing, so here's the explanation
# hg in -q --template '{branch}\n' -> Ask for the incoming changes, in quiet mode (display only the changesets) with a tempate, displaying only the branches
# grep -v feature/ -> Display only the branches that are NOT feature branches (feature branches have a feature/ prefix)
# sort -u -> Sort the records and eliminate duplicates.
# > branches -> Save the output to a file called 'branches'
hg in -q --template '{branch}\n' | grep -v feature/ | sort -u > branches
hg in -q -b default
if [ $? -eq "0" ] then
echo "default" >> branches
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment