Skip to content

Instantly share code, notes, and snippets.

@rpl
Last active June 21, 2019 23:20
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 rpl/54aee2c5e64e95072c516c8f62134477 to your computer and use it in GitHub Desktop.
Save rpl/54aee2c5e64e95072c516c8f62134477 to your computer and use it in GitHub Desktop.
some useful mercurial aliases
[revsetalias]
# pending commits (used in `hg lg` and `hg lgs aliases`)
pending = ancestors(.)&draft()
# recent bookmarks (used in `hg rbm` alias)
recent_bookmarks($1) = limit(reverse(sort(bookmark())), $1)
[alias]
# log only pendings commits
lg = log -r 'pending'
# log only pendings commits
lgs = log -r 'pending' --stat
# show pending commits including their content
lgp = log -pr 'pending'
# export all patches in a target dir (e.g. `hg ep ~/PATCHES/somedir/`)
ep = export -g -r 'pending' -o "$1/%n-%m.patch"
# just a shortcut for `hg bookmark` commands
bm = bookmark
# history edit shortcut
he = histedit -r 'pending'
# print stats on all the pending commits in the current bookmark
pending-stats = churn --diffstat -r 'pending'
# print the most recent N bookmarks (e.g. `hg rbm 10`)
rbm = log -r recent_bookmarks($1) -T bookmarks
# just a shortcut to get the last 5 active bookmarks
rbm5 = rbm 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment