hgrc @ f6bdfbdf747e

More
author Steve Losh <steve@stevelosh.com>
date Wed, 27 Mar 2024 15:17:47 -0400
parents c0175626e056
children 30faa48af4ce
[ui]
username = Steve Losh <steve@stevelosh.com>
editor = nvim
commitsubrepos = False
ignore = ~/.hgignore
paginate = never

[extensions]
transplant = 
graphlog =
record = 
bookmarks = 
rebase = 
purge = 
mq = 
patchbomb =
extdiff = 
color = 
parentrevspec =
schemes = 
progress =
fetch =
shelve = 
histedit = 
absorb = 
prompt   = ~/src/dotfiles/mercurial/hg-prompt/prompt.py
hggit    = ~/.hg-git/hggit

[absorb]
# only check 50 recent non-public changesets at most
max-stack-size = 50
# whether to add noise to new commits to avoid obsolescence cycle
add-noise = 1
# make `amend --correlated` a shortcut to the main command
amend-flag = correlated

[color]
absorb.description = yellow
absorb.node = blue bold
absorb.path = bold

[progress]
delay = 1.0

[web]
cacerts = 

[schemes]
gh = git://github.com/
ghs = git+ssh://git@github.com/
hsl = ssh://hsl/repos/

[diff]
git = True
unified = 5

[extdiff]
cmd.vd = nvim
opts.vd = -c 'set lines=70' -c 'set columns=240' '+next' '+execute "DirDiff" argv(0) argv(1)'

[merge-tools]
splice.executable = nvim
splice.args = -f $base $local $other $output -c 'SpliceInit'
splice.premerge = keep
splice.priority = 1

keepthat.executable = sh
keepthat.args = -c 'cp "$local" "$output.original" && cp "$other" "$output"'
keepthat.premerge = True

keepthis.executable = sh
keepthis.args = -c 'cp "$other" "$output.incoming" && cp "$local" "$output"'
keepthis.premerge = True

unityyamlmerge.executable = /Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge
unityyamlmerge.args = merge -p --force $base $other $local $output
unityyamlmerge.checkprompt = True
unityyamlmerge.premerge = False
unityyamlmerge.binary = False

[merge-patterns]
**.unity = unityyamlmerge
**.prefab = unityyamlmerge

[email]
method = msmtp-stevelosh
from = Steve Losh <steve@stevelosh.com>

[subrepos]
git:allowed = true

[smtp]
host = smtp.fastmail.com
port = 465
username = steve@stevelosh.com
tls = True

[color]
status.modified = cyan
status.added = green
status.removed = red
status.deleted = yellow bold underline
status.unknown = magenta bold underline
status.ignored = black bold
diff.diffline = none
diff.extended = cyan
diff.file_a = red
diff.file_b = green
diff.hunk = yellow bold
diff.deleted = red
diff.inserted = green
diff.changed = white
diff.trailingwhitespace = white_background

[bookmarks]
track.current = True

[defaults]
rebase = --keepbranches
addremove = --similarity 100

[alias]
# Nudge: just push the current branch.
nudge = push --branch .

# Some useful little aliases.
st = status -SC
stl = !"$HG" status -SC --color=always | less -SR
? = summary
fdiff = diff -U 10000000000000


# Push to the git mirror at the same time.
pg = !"$HG" push; "$HG" push git

# Push to all
pa = !"$HG" paths -q | xargs -l1 "$HG" push

# Commit message shortcuts.
cm = commit -m
cus = commit -m 'Update subrepository state'
cmm = commit -m 'Merge'
ct = commit -m 'Update TODO' TODO .TODO.done
cb = commit -m 'Close branch' --close-branch
cmore = commit -m 'More'

# Merge shortcuts.
mergelocal = !$HG --config ui.merge=internal:local merge $@
mergeother = !$HG --config ui.merge=internal:other merge $@
mergefail = !$HG --config ui.merge=internal:fail merge $@

# Shortcuts to resolve merge conflicts by taking one side or the other.
takelocal = !"$HG" revert --rev 'p1()' $@ && "$HG" resolve -m $@
takeother = !"$HG" revert --rev 'p2()' $@ && "$HG" resolve -m $@

# Diff.
d = diff -p --color=auto

# Run a colored diff and pipe it to less.
dl = !"$HG" diff -p --color=never $@ | nvim -R -c 'set ft=diff' -

# Log shortcuts --------------------------------------------------------------------
#
# Each of these can be used with -v to add a bit more info.

# Datelog: short, pretty hg log with dates.
dlog = log --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.dlog
_ = dlog -l15
__ = _ -l100000000
o_ = outgoing -n --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.dlog
i_ = incoming -n --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.dlog

# Shortlog: short, pretty hg log.
slog = log --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.slog
. = slog -l15
.. = . -l100000000
o. = outgoing -n --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.slog
i. = incoming -n --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.slog

# Short graphlog: short, pretty hg log with a graph.
sglog = glog --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.sglog
, = sglog -l7
,, = , -l100000000
o, = outgoing --graph --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.sglog
i, = incoming --graph --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.sglog

# Incoming and Outgoing all in one
inout = !heading smallslant incoming; "$HG" incoming $@; heading smallslant outgoing; "$HG" outgoing $@

# hg n .     -- show a summary of rev . without diff.
# hg show .  -- show a summary of rev . with diff.
# hg sl .    -- show a summary of rev . with diff, piped to less
nlog = log --style=$HOME/src/dotfiles/mercurial/templates/map-cmdline.nlog
n = nlog -vr
show = nlog --color=always -vpr
sl = !"$HG" nlog --color=always -vpr $@ | less -R

# Simple glog command that doesn't look bad and doesn't require my CLI templates.
gl = glog -l10 --template='\033[0;33m{rev}\033[0m {desc|firstline|strip} \033[0;35m{branches}\033[0m \033[0;33m{tags}\033[0m\n\033[1;30m({date|age} by {author|person})\033[0m\n\n'

# Edit the current repo's hgrc file.
erc = !$EDITOR `$HG root`/.hg/hgrc

# Easily add ignore patterns to .hgignore and commit.
ignore = ![ -n "$@" ] && echo '$@' >> `$HG root`/.hgignore && \
          $HG commit `$HG root`/.hgignore -Am 'Add "$@" to .hgignore'

# Show in Vim
vshow = !$HG show $@ --color=never | nvim -c 'setlocal buftype=nofile ft=diff' -
vdiff = !$HG diff -p --color=always $@ | nvim -c ':AnsiEsc' -c 'setlocal buftype=nofile' -

git-hash = log --template '{gitnode}' --rev

# Local settings
%include ~/.hgrc_local