Patchwork [4,of,4] changeset_printer: use changectx to get status tuple

login
register
mail settings
Submitter Yuya Nishihara
Date March 27, 2015, 3:24 p.m.
Message ID <80a3c940d67309d75559.1427469888@mimosa>
Download mbox | patch
Permalink /patch/8311/
State Accepted
Headers show

Comments

Yuya Nishihara - March 27, 2015, 3:24 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1426322447 -32400
#      Sat Mar 14 17:40:47 2015 +0900
# Node ID 80a3c940d67309d75559b13b031378789aa400a3
# Parent  9e42a6eebfdf5b33502be8ac4291c4bc1f9f2eca
changeset_printer: use changectx to get status tuple

log.parents() can't handle wdir() revision. Because repo.status() creates ctx
objects, there would be no benefit to get parent node from changelog.
Matt Mackall - March 27, 2015, 8:19 p.m.
On Sat, 2015-03-28 at 00:24 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1426322447 -32400
> #      Sat Mar 14 17:40:47 2015 +0900
> # Node ID 80a3c940d67309d75559b13b031378789aa400a3
> # Parent  9e42a6eebfdf5b33502be8ac4291c4bc1f9f2eca
> changeset_printer: use changectx to get status tuple
> 
> log.parents() can't handle wdir() revision. Because repo.status() creates ctx
> objects, there would be no benefit to get parent node from changelog.

These are queued for default, thanks.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1110,7 +1110,6 @@  class changeset_printer(object):
                           label='log.node')
             return
 
-        log = self.repo.changelog
         date = util.datestr(ctx.date())
 
         if self.ui.debugflag:
@@ -1166,7 +1165,7 @@  class changeset_printer(object):
                       label='log.date')
 
         if self.ui.debugflag:
-            files = self.repo.status(log.parents(changenode)[0], changenode)[:3]
+            files = ctx.p1().status(ctx)[:3]
             for key, value in zip([# i18n: column positioning for "hg log"
                                    _("files:"),
                                    # i18n: column positioning for "hg log"