##// END OF EJS Templates
log: use namespace logname and colorname...
Sean Farley -
r23876:48fd1dfb default
parent child Browse files
Show More
@@ -920,8 +920,8 b' class changeset_printer(object):'
920 # should be the same
920 # should be the same
921 for name in ns.names(self.repo, changenode):
921 for name in ns.names(self.repo, changenode):
922 # i18n: column positioning for "hg log"
922 # i18n: column positioning for "hg log"
923 tname = _(("%s:" % ns.templatename).ljust(13) + "%s\n") % name
923 name = _(("%s:" % ns.logname).ljust(13) + "%s\n") % name
924 self.ui.write("%s" % tname, label='log.%s' % ns.templatename)
924 self.ui.write("%s" % name, label='log.%s' % ns.colorname)
925 if self.ui.debugflag:
925 if self.ui.debugflag:
926 # i18n: column positioning for "hg log"
926 # i18n: column positioning for "hg log"
927 self.ui.write(_("phase: %s\n") % _(ctx.phasestr()),
927 self.ui.write(_("phase: %s\n") % _(ctx.phasestr()),
@@ -1571,8 +1571,9 b' Check that adding an arbitrary name show'
1571 > namemap = lambda r, name: foo.get(name)
1571 > namemap = lambda r, name: foo.get(name)
1572 > nodemap = lambda r, node: [name for name, n in foo.iteritems()
1572 > nodemap = lambda r, node: [name for name, n in foo.iteritems()
1573 > if n == node]
1573 > if n == node]
1574 > ns = namespace("bars", templatename="bar", listnames=names,
1574 > ns = namespace("bars", templatename="bar", logname="barlog",
1575 > namemap=namemap, nodemap=nodemap)
1575 > colorname="barcolor", listnames=names, namemap=namemap,
1576 > nodemap=nodemap)
1576 >
1577 >
1577 > repo.names.addnamespace(ns)
1578 > repo.names.addnamespace(ns)
1578 > EOF
1579 > EOF
@@ -1580,11 +1581,24 b' Check that adding an arbitrary name show'
1580 $ hg --config extensions.names=../names.py log -r 0
1581 $ hg --config extensions.names=../names.py log -r 0
1581 changeset: 0:65624cd9070a
1582 changeset: 0:65624cd9070a
1582 tag: tip
1583 tag: tip
1583 bar: foo
1584 barlog: foo
1584 user: test
1585 user: test
1585 date: Thu Jan 01 00:00:00 1970 +0000
1586 date: Thu Jan 01 00:00:00 1970 +0000
1586 summary: a bunch of weird directories
1587 summary: a bunch of weird directories
1587
1588
1589 $ hg --config extensions.names=../names.py \
1590 > --config extensions.color= --config color.log.barcolor=red \
1591 > --color=always log -r 0
1592 \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc)
1593 tag: tip
1594 \x1b[0;31mbarlog: foo\x1b[0m (esc)
1595 user: test
1596 date: Thu Jan 01 00:00:00 1970 +0000
1597 summary: a bunch of weird directories
1598
1599 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
1600 foo
1601
1588 $ cd ..
1602 $ cd ..
1589
1603
1590 hg log -f dir across branches
1604 hg log -f dir across branches
General Comments 0
You need to be logged in to leave comments. Login now