From patchwork Fri Jun 13 23:56:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,5] patch: use ctx.node() instead of bare node variable From: Sean Farley X-Patchwork-Id: 5001 Message-Id: To: mercurial-devel@selenic.com Date: Fri, 13 Jun 2014 16:56:02 -0700 # HG changeset patch # User Sean Farley # Date 1376503827 18000 # Wed Aug 14 13:10:27 2013 -0500 # Node ID b8c00606fe83ee6ac806908fd48a182b1eb6f2e8 # Parent 0f73ed6293629f69aa2f01d8940e91faeded49ae patch: use ctx.node() instead of bare node variable Future patches will allow patch.diff to take a basectx so node1 (and node2) could make hexfunc error out. Instead, we'll call the node function on the context object directly. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1619,11 +1619,11 @@ def diff(repo, node1=None, node2=None, m if not modified and not added and not removed: return [] revs = None hexfunc = repo.ui.debugflag and hex or short - revs = [hexfunc(node) for node in [node1, node2] if node] + revs = [hexfunc(node) for node in [ctx1.node(), ctx2.node()] if node] copy = {} if opts.git or opts.upgrade: copy = copies.pathcopies(ctx1, ctx2)