diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -325,10 +325,14 @@ class changeset_templater(changeset_prin def __init__(self, ui, repo, patch, brinfo, mapfile, buffered): changeset_printer.__init__(self, ui, repo, patch, brinfo, buffered) - self.t = templater.templater(mapfile, templater.common_filters, - cache={'parent': '{rev}:{node|short} ', - 'manifest': '{rev}:{node|short}', - 'filecopy': '{name} ({source})'}) + filters = templater.common_filters.copy() + filters['formatnode'] = (ui.debugflag and (lambda x: x) + or (lambda x: x[:12])) + self.t = templater.templater(mapfile, filters, + cache={ + 'parent': '{rev}:{node|formatnode} ', + 'manifest': '{rev}:{node|formatnode}', + 'filecopy': '{name} ({source})'}) def use_template(self, t): '''set template string to use'''