Skip to content

Instantly share code, notes, and snippets.

@demoive
Last active December 2, 2015 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demoive/8d9c3241936ddb9284be to your computer and use it in GitHub Desktop.
Save demoive/8d9c3241936ddb9284be to your computer and use it in GitHub Desktop.
Template file for Mercurial smartlog
changeset = "{shortest(node)} {label('blue', '{author|user}')}{if(phabdiff, label('bold', \" {phabdiff}\"))}{bookmarks} {label('cyan', '({date|age})')}\n{desc|firstline}{ifeq(rev, revset('.'), '{files}{file_mods}{file_adds}{file_dels}')}\n\n"
# CURRENTLY, for some reason, the ifeq() condition doesn't work
# I think it's because we're doing the check with "current" inside this "bookmark variable"
bookmark = " {ifeq(bookmark, current, label('yellow', '{bookmark}*'), label('green', '{bookmark}'))}"
#start_files = "ALL:\n"
start_files = "\n\n {sub(\"(\d+):\s+\+(\d+)\/-(\d+)\", label('magenta underline', '\\1 files changed: +\\2/-\\3:'), diffstat)}"
file = ""
end_files = ""
#start_file_mods = "MODIFIED:\n"
file_mod = "\n M {file_mod}"
#end_file_mods = "\n"
#start_file_adds = "ADDED:\n"
file_add = "\n A {file_add}"
#end_file_adds = "\n"
#start_file_dels = "REMOVED:\n"
file_del = "\n R {file_del}"
#end_file_dels = "\n"
@demoive
Copy link
Author

demoive commented Dec 2, 2015

With diffstat, we lose the performance benefit that using --style gave to the smartlog :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment