programs: mercurial: add "qcat" alias

This commit is contained in:
2025-07-21 23:20:20 +00:00
parent 2db59f380c
commit eb304c6b61

View File

@@ -14,11 +14,17 @@ git = True
# unified = 10 # unified = 10
[alias] [alias]
noop = !$HG > /dev/null
q = qseries -s -v 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 # `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 qpop -a ; cp -R $($HG qpath) .hg/patches-$1 ; echo $1 >> .hg/patches.queues ; $HG qqueue $1
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
qstat = qdiff --stat qstat = qdiff --stat
sblame = blame -undq sblame = blame -undq
# #