mercurial: have "qcat" use "colordiff" for syntax higlighting

This commit is contained in:
2025-07-21 23:39:22 +00:00
parent eb304c6b61
commit 58b87e32e3
3 changed files with 5 additions and 1 deletions

View File

@@ -143,6 +143,7 @@ in
"cdecl" # like <https://cdecl.org>. `cdecl explain 'struct foo *const inst'` "cdecl" # like <https://cdecl.org>. `cdecl explain 'struct foo *const inst'`
# "cdrtools" # "cdrtools"
# "clinfo" # "clinfo"
"colordiff"
# "dmidecode" # "dmidecode"
"dtrx" # `unar` alternative, "Do The Right eXtraction" "dtrx" # `unar` alternative, "Do The Right eXtraction"
# "efivar" # "efivar"
@@ -487,6 +488,8 @@ in
"/var/lib/clightning/bitcoin/lightning-rpc" "/var/lib/clightning/bitcoin/lightning-rpc"
]; ];
colordiff.sandbox.autodetectCliPaths = "existingFile"; # for `aplay ./file.wav`
# cryptsetup: typical use is `cryptsetup open /dev/loopxyz mappedName`, and creates `/dev/mapper/mappedName` # cryptsetup: typical use is `cryptsetup open /dev/loopxyz mappedName`, and creates `/dev/mapper/mappedName`
cryptsetup.sandbox.extraPaths = [ cryptsetup.sandbox.extraPaths = [
"/dev/mapper" "/dev/mapper"

View File

@@ -4,6 +4,7 @@
packageUnwrapped = pkgs.mercurialFull; packageUnwrapped = pkgs.mercurialFull;
sandbox.wrapperType = "inplace"; # etc/mercurial/hgrc refers to hg python-path (to define an extension) sandbox.wrapperType = "inplace"; # etc/mercurial/hgrc refers to hg python-path (to define an extension)
suggestedPrograms = [ suggestedPrograms = [
"colordiff" #< optional, for my hgrc aliases
"less" #< TODO: this might be a missing dependency on the nix side of things? "less" #< TODO: this might be a missing dependency on the nix side of things?
]; ];
sandbox.net = "clearnet"; sandbox.net = "clearnet";

View File

@@ -21,7 +21,7 @@ q = qseries -s -v
qpath = !$HG noop ; echo ".hg/patches-$($HG qqueue --active)" | sed 's:hg/patches-patches:hg/patches:' 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. # `hg qcat PATCH_NAME`: view the diff of a mq patch in the current queue.
qcat = !$HG noop ; cat $($HG qpath)/$1 qcat = !$HG noop ; cat $($HG qpath)/$1 | colordiff --nobanner
# #
# `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
qdup = !$HG qpop -a ; cp -R $($HG qpath) .hg/patches-$1 ; echo $1 >> .hg/patches.queues ; $HG qqueue $1 qdup = !$HG qpop -a ; cp -R $($HG qpath) .hg/patches-$1 ; echo $1 >> .hg/patches.queues ; $HG qqueue $1