changeset 3462:fab28100ea88

Added extra changeset info to templater and map-cmdline.default.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 18 Oct 2006 18:09:32 +0200
parents 451ec905625b
children 031aac7ec584
files mercurial/templater.py templates/map-cmdline.default
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Wed Oct 18 17:58:51 2006 +0200
+++ b/mercurial/templater.py	Wed Oct 18 18:09:32 2006 +0200
@@ -310,6 +310,7 @@
     "strip": lambda x: x.strip(),
     "urlescape": lambda x: urllib.quote(x),
     "user": lambda x: util.shortuser(x),
+    "stringescape": lambda x: x.encode('string_escape'),
     }
 
 def templatepath(name=None):
@@ -464,6 +465,14 @@
             for x in showlist('tag', self.repo.nodetags(changenode), **args):
                 yield x
 
+        def showextras(**args):
+            extras = changes[5].items()
+            extras.sort()
+            for key, value in extras:
+                args = args.copy()
+                args.update(dict(key=key, value=value))
+                yield self.t('extra', **args)
+
         if self.ui.debugflag:
             files = self.repo.status(log.parents(changenode)[0], changenode)[:3]
             def showfiles(**args):
@@ -499,6 +508,7 @@
             'parents': showparents,
             'rev': rev,
             'tags': showtags,
+            'extras': showextras,
             }
         props = props.copy()
         props.update(defprops)
--- a/templates/map-cmdline.default	Wed Oct 18 17:58:51 2006 +0200
+++ b/templates/map-cmdline.default	Wed Oct 18 18:09:32 2006 +0200
@@ -1,7 +1,7 @@
 changeset = 'changeset:   {rev}:{node|short}\n{branches}{tags}{short_parents}user:        {author}\ndate:        {date|date}\nsummary:     {desc|firstline}\n\n'
 changeset_quiet = '{rev}:{node|short}\n'
 changeset_verbose = 'changeset:   {rev}:{node|short}\n{branches}{tags}{parents}{manifest}user:        {author}\ndate:        {date|date}\n{files}{file_adds}{file_dels}{file_copies}description:\n{desc|strip}\n\n\n'
-changeset_debug = 'changeset:   {rev}:{node}\n{branches}{tags}{parents}{manifest}user:        {author}\ndate:        {date|date}\n{files}{file_adds}{file_dels}{file_copies}description:\n{desc|strip}\n\n\n'
+changeset_debug = 'changeset:   {rev}:{node}\n{branches}{tags}{parents}{manifest}user:        {author}\ndate:        {date|date}\n{files}{file_adds}{file_dels}{file_copies}{extras}description:\n{desc|strip}\n\n\n'
 start_files = 'files:      '
 file = ' {file}'
 end_files = '\n'
@@ -19,3 +19,4 @@
 manifest = 'manifest:    {rev}:{node}\n'
 branch = 'branch:      {branch}\n'
 tag = 'tag:         {tag}\n'
+extra = 'extra:       {key}={value|stringescape}\n'