Skip to content

Instantly share code, notes, and snippets.

@demoive
Last active December 3, 2015 00:06
Show Gist options
  • Save demoive/95c52cb8c753cc68da29 to your computer and use it in GitHub Desktop.
Save demoive/95c52cb8c753cc68da29 to your computer and use it in GitHub Desktop.
My config settings for Mercurial
[ui]
username = Paulo Avila #<>
status.modified = blue bold # M
status.added = green bold # A
status.removed = red bold # R
#status.clean = # C
#status.deleted = cyan bold #
#status.missing = # !
#status.untracked = blue bold # ?
#status.ignored = black bold # I
#color.sl.diff=bold
#color.sl.curbook=yellow
#color.sl.book=green
#color.sl.rembook=green
#color.sl.branch=bold
#color.evolution.troubles=red
[alias]
#sl = smartlog --template "{shortest(node, 6)} {author|user} {label(\"sl.diff\", phabdiff)}{if(phabdiff, \" \")}{bookmarks % '{ifeq(bookmark, current, label(\"sl.curbook\", \"{bookmark}* \"))}'}{bookmarks % '{ifeq(bookmark, current, \"\", label(\"sl.book\", \"{bookmark} \"))}'}{if(bookmarks, if(remotebookmarks, \"\", \" \"))}{if(remotebookmarks, label(\"sl.rembook\", \"{remotebookmarks} \"))}{ifeq(branch, 'default', '', label(\"sl.branch\", \"{branch} \"))} {label(\"evolution.troubles\", troubles)}\n{desc|firstline}\n\n"
# Smart Log (long) - sll
# - Using the native `--commit-info` gives *all* changes (instead of just Modified/Added/Removed) and a performance gain
sll = smartlog --commit-info --template "{shortest(node)} {label('blue', \"{author|user}\")}{if(phabdiff, label('bold', \" {phabdiff}\"))}{bookmarks % ' {ifeq(bookmark, current, label(\"yellow\", \"{bookmark}*\"), label(\"green\", \"{bookmark}\"))}'} {label(\"cyan\", \"({date|age})\")}\n{desc|firstline}\n\n"
# Intelligent Log - il
# - Used before the `--commit-info` option was added in D1677101 (t5418936)
# - Also reveals more info about the changes with diffstat
il = smartlog --template "{shortest(node)} {label('blue', \"{author|user}\")}{if(phabdiff, label('bold', \" {phabdiff}\"))}{bookmarks % ' {ifeq(bookmark, current, label(\"yellow\", \"{bookmark}*\"), label(\"green\", \"{bookmark}\"))}'} {label(\"cyan\", \"({date|age})\")}\n{desc|firstline}{ifeq(rev, revset('.'), '\n{file_mods % \'\n M {file}\'}{file_adds % \'\n A {file}\'}{file_dels % \'\n R {file}\'}\n ({sub(\"(\d+):\s+\+(\d+)\/-(\d+)\", \"\\\1 files changed: +\\\2/-\\\3\", diffstat)})')}\n\n"
# Genius Log
# - Colors the individual changeset statuses
gl = smartlog --template "{shortest(node)} {label('blue', \"{author|user}\")}{if(phabdiff, label('bold', \" {phabdiff}\"))}{bookmarks % ' {ifeq(bookmark, current, label(\"yellow\", \"{bookmark}*\"), label(\"green\", \"{bookmark}\"))}'} {label(\"cyan\", \"({date|age})\")}\n{desc|firstline}{ifeq(rev, revset('.'), '\n{file_mods % \'\n {label(\"status.modified\", \"M\")} {label(\"magenta\", \"{file}\")}\'}{file_adds % \'\n {label(\"status.added\", \"A\")} {label(\"magenta\", \"{file}\")}\'}{file_dels % \'\n {label(\"status.removed\", \"R\")} {label(\"magenta\", \"{file}\")}\'}\n ({sub(\"(\d+):\s+\+(\d+)\/-(\d+)\", \"\\\1 files changed: +\\\2/-\\\3\", diffstat)})')}\n\n"
# Very Smart Log
# - Doesn't highlight current bookmark (yellow & asterix)
# - Underline's the `diffstat` info without having to colorize it appropriately
vsl = smartlog --style ~/.hg_template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment