Patchwork D3009: diff: simplify by converting contexts to nodeids a little later

login
register
mail settings
Submitter phabricator
Date April 1, 2018, 10:37 a.m.
Message ID <2c7705e9fa41cf475b9ee8482da8fdca@localhost.localdomain>
Download mbox | patch
Permalink /patch/30112/
State Not Applicable
Headers show

Comments

phabricator - April 1, 2018, 10:37 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4e573e7e512d: diff: simplify by converting contexts to nodeids a little later (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3009?vs=7489&id=7497

REVISION DETAIL
  https://phab.mercurial-scm.org/D3009

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1874,18 +1874,18 @@ 
         raise error.Abort(msg)
     elif change:
         repo = scmutil.unhidehashlikerevs(repo, [change], 'nowarn')
-        node2 = scmutil.revsingle(repo, change, None).node()
-        node1 = repo[node2].p1().node()
+        ctx2 = scmutil.revsingle(repo, change, None)
+        ctx1 = ctx2.p1()
     else:
         repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn')
         ctx1, ctx2 = scmutil.revpair(repo, revs)
-        node1, node2 = ctx1.node(), ctx2.node()
+    node1, node2 = ctx1.node(), ctx2.node()
 
     if reverse:
         node1, node2 = node2, node1
 
     diffopts = patch.diffallopts(ui, opts)
-    m = scmutil.match(repo[node2], pats, opts)
+    m = scmutil.match(ctx2, pats, opts)
     ui.pager('diff')
     logcmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
                               listsubrepos=opts.get('subrepos'),