# HG changeset patch # User Sean Farley # Date 2015-01-15 04:29:47 # Node ID 48fd1dfb99aa81bdaef0c47d43d88f0f6e8d4f50 # Parent e573dd08aeaf4cbc2ea00c9046246f14eeaeed2f log: use namespace logname and colorname Now that we have the machinary to change the log name and the color label used, let's use that. Tests have been updated accordingly. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -920,8 +920,8 @@ class changeset_printer(object): # should be the same for name in ns.names(self.repo, changenode): # i18n: column positioning for "hg log" - tname = _(("%s:" % ns.templatename).ljust(13) + "%s\n") % name - self.ui.write("%s" % tname, label='log.%s' % ns.templatename) + name = _(("%s:" % ns.logname).ljust(13) + "%s\n") % name + self.ui.write("%s" % name, label='log.%s' % ns.colorname) if self.ui.debugflag: # i18n: column positioning for "hg log" self.ui.write(_("phase: %s\n") % _(ctx.phasestr()), diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -1571,8 +1571,9 @@ Check that adding an arbitrary name show > namemap = lambda r, name: foo.get(name) > nodemap = lambda r, node: [name for name, n in foo.iteritems() > if n == node] - > ns = namespace("bars", templatename="bar", listnames=names, - > namemap=namemap, nodemap=nodemap) + > ns = namespace("bars", templatename="bar", logname="barlog", + > colorname="barcolor", listnames=names, namemap=namemap, + > nodemap=nodemap) > > repo.names.addnamespace(ns) > EOF @@ -1580,11 +1581,24 @@ Check that adding an arbitrary name show $ hg --config extensions.names=../names.py log -r 0 changeset: 0:65624cd9070a tag: tip - bar: foo + barlog: foo user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a bunch of weird directories + $ hg --config extensions.names=../names.py \ + > --config extensions.color= --config color.log.barcolor=red \ + > --color=always log -r 0 + \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc) + tag: tip + \x1b[0;31mbarlog: foo\x1b[0m (esc) + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: a bunch of weird directories + + $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n' + foo + $ cd .. hg log -f dir across branches