Patchwork templatekw: have {manifest} use ctx.manifestnode() for consistency

login
register
mail settings
Submitter Yuya Nishihara
Date April 9, 2015, 12:55 p.m.
Message ID <4d15abaf0a323e059edb.1428584144@mimosa>
Download mbox | patch
Permalink /patch/8569/
State Accepted
Commit 13c42a883e8be38b58e12465ac87680f7035f9bc
Headers show

Comments

Yuya Nishihara - April 9, 2015, 12:55 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1428494646 -32400
#      Wed Apr 08 21:04:06 2015 +0900
# Node ID 4d15abaf0a323e059edb1b8753cdaaed26f02af4
# Parent  19c5b091396036e2ee63555b39a5852652b49d18
templatekw: have {manifest} use ctx.manifestnode() for consistency

changeset_printer was updated at f57640bf10d4 to not access changeset by
index.
Matt Mackall - April 9, 2015, 5:40 p.m.
On Thu, 2015-04-09 at 21:55 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1428494646 -32400
> #      Wed Apr 08 21:04:06 2015 +0900
> # Node ID 4d15abaf0a323e059edb1b8753cdaaed26f02af4
> # Parent  19c5b091396036e2ee63555b39a5852652b49d18
> templatekw: have {manifest} use ctx.manifestnode() for consistency

Queued for default, thanks.

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -333,9 +333,9 @@  def showlatesttagdistance(repo, ctx, tem
 
 def showmanifest(**args):
     repo, ctx, templ = args['repo'], args['ctx'], args['templ']
+    mnode = ctx.manifestnode()
     args = args.copy()
-    args.update({'rev': repo.manifest.rev(ctx.changeset()[0]),
-                 'node': hex(ctx.changeset()[0])})
+    args.update({'rev': repo.manifest.rev(mnode), 'node': hex(mnode)})
     return templ('manifest', **args)
 
 def shownode(repo, ctx, templ, **args):