# HG changeset patch # User Augie Fackler # Date 1468934453 14400 # Node ID 1a85ad164ae7e60e441a9fe1499e800515eeb2f5 # Parent 1cda3348f36b29ab54005788596e33e94941f489 hg: refactor sl template to use templatealias for readability diff --git a/.hgrc b/.hgrc --- a/.hgrc +++ b/.hgrc @@ -72,8 +72,17 @@ sl = log -Gr smart -Tsl si = incoming -GTsl sl. = log -Gr 'smart and ::.' -Tsl +[templatealias] +sl_branch = '{ifeq(branch,"default","","{label(black_background, branch)} ")}' +sl_node = '{label("log.changeset changeset.{phase}", shortest(node))}' +sl_user = '{label("grep.user", author|user)}' +sl_tags = '{label("tags.normal", if(tags," {tags}"))}' +sl_book = '{label("sl.book", if(bookmarks," {bookmarks}"))}' +sl_topic = '{label("sl.topic", if(topics," {topics}"))}' +sl_desc = '{label(ifcontains(rev, revset('.'), 'desc.here'),desc|firstline)}' + [templates] -sl = '{ifeq(branch,"default","","{label(black_background, branch)} ")}{label("log.changeset changeset.{phase}", shortest(node))} {label("grep.user", author|user)}{label("tags.normal", if(tags," {tags}"))}{label("sl.book", if(bookmarks," {bookmarks}"))}{label("sl.topic", if(topics," {topics}"))}\n{label(ifcontains(rev, revset('.'), 'desc.here'),desc|firstline)}' +sl = '{sl_branch}{sl_node} {sl_user}{sl_tags}{sl_book}{sl_topic}\n{sl_desc}' [color] sl.book = magenta bold