diff mercurial/logcmdutil.py @ 39811:ba93db1745ba

log: have changesetformatter fill in wdir() rev and node (BC) This matches the behavior of the default template keywords. wdir() support is still experimental so we can change the output.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 15 Sep 2018 17:26:20 +0900
parents fa681452b249
children 94ca3579e84e
line wrap: on
line diff
--- a/mercurial/logcmdutil.py	Sun Sep 23 16:11:01 2018 +0900
+++ b/mercurial/logcmdutil.py	Sat Sep 15 17:26:20 2018 +0900
@@ -325,16 +325,9 @@
         '''show a single changeset or file revision'''
         fm = self._fm
         fm.startitem()
-
         fm.context(ctx=ctx)
-        # TODO: maybe this should be wdirrev/wdirnode?
-        rev = ctx.rev()
-        if rev is None:
-            hexnode = None
-        else:
-            hexnode = fm.hexfunc(ctx.node())
-        fm.data(rev=rev,
-                node=hexnode)
+        fm.data(rev=scmutil.intrev(ctx),
+                node=fm.hexfunc(scmutil.binnode(ctx)))
 
         if self.ui.quiet:
             return
@@ -350,7 +343,7 @@
                                        for c in ctx.parents()], name='node'))
 
         if self.ui.debugflag:
-            if rev is None:
+            if ctx.rev() is None:
                 hexnode = None
             else:
                 hexnode = fm.hexfunc(ctx.manifestnode())