Patchwork [1,of,3] cat: use ctx.manifestnode() in place of ctx._changeset[0]

login
register
mail settings
Submitter Yuya Nishihara
Date April 11, 2015, 8:06 a.m.
Message ID <2b6e0ebec09f408f7950.1428739581@mimosa>
Download mbox | patch
Permalink /patch/8611/
State Accepted
Commit 70b9c79cbe7ba624e3b1d8eaa5e1eca64b1a0f4c
Headers show

Comments

Yuya Nishihara - April 11, 2015, 8:06 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1428735702 -32400
#      Sat Apr 11 16:01:42 2015 +0900
# Node ID 2b6e0ebec09f408f79508a057cdd444bd391d2ac
# Parent  52ff737c63d2b2cb41185549aa9c35bc47317032
cat: use ctx.manifestnode() in place of ctx._changeset[0]

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2402,7 +2402,7 @@  def cat(ui, repo, ctx, matcher, prefix, 
     if len(matcher.files()) == 1 and not matcher.anypats():
         file = matcher.files()[0]
         mf = repo.manifest
-        mfnode = ctx._changeset[0]
+        mfnode = ctx.manifestnode()
         if mf.find(mfnode, file)[0]:
             write(file)
             return 0