Skip to content

Instantly share code, notes, and snippets.

@gijsk
Created November 30, 2018 15:41
Show Gist options
  • Save gijsk/231be8b4e9a1b033c8144f842d115bbb to your computer and use it in GitHub Desktop.
Save gijsk/231be8b4e9a1b033c8144f842d115bbb to your computer and use it in GitHub Desktop.
Bash function that rebases all draft branches from rev 1 to rev 2. Useful for keeping sets of patches updated to m-c.
rebase_all_drafts() {
local TO_REBASE=`hg log -r "draft() & children($1)" --template '{node}\n'`
while read -r line; do
echo "Running: hg rebase -s $line -d $2"
hg rebase -s "$line" -d $2
done <<< "$TO_REBASE"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment