Skip to content

Instantly share code, notes, and snippets.

@patoarvizu
Last active December 19, 2015 03:08
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 patoarvizu/5887789 to your computer and use it in GitHub Desktop.
Save patoarvizu/5887789 to your computer and use it in GitHub Desktop.
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