diff --git a/hosts/common/programs/mercurial/hgrc b/hosts/common/programs/mercurial/hgrc index 4c6a64de9..8414e704e 100644 --- a/hosts/common/programs/mercurial/hgrc +++ b/hosts/common/programs/mercurial/hgrc @@ -14,11 +14,17 @@ git = True # unified = 10 [alias] +noop = !$HG > /dev/null q = qseries -s -v # +# `hg qpath`: print the path to the current queue +qpath = !$HG noop ; echo ".hg/patches-$($HG qqueue --active)" | sed 's:hg/patches-patches:hg/patches:' +# +# `hg qcat PATCH_NAME`: view the diff of a mq patch in the current queue. +qcat = !$HG noop ; cat $($HG qpath)/$1 +# # `hg qdup NEW_QUEUE_NAME`: copy all patches in the current queue into a new queue -# current queue must not be named "patches" -qdup = !$HG qq --active > /tmp/hg.active ; $HG qpop -a ; cp -R .hg/patches-$(cat /tmp/hg.active) .hg/patches-$1 ; echo $1 >> .hg/patches.queues ; $HG qq $1 +qdup = !$HG qpop -a ; cp -R $($HG qpath) .hg/patches-$1 ; echo $1 >> .hg/patches.queues ; $HG qqueue $1 qstat = qdiff --stat sblame = blame -undq #