[Updated] [+ ] D8503: diff: avoid going from contexts to nodes and back
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Mon May 11 21:35:22 UTC 2020
durin42 updated this revision to Diff 21340.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8503?vs=21317&id=21340
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8503/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8503
AFFECTED FILES
mercurial/commands.py
CHANGE DETAILS
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2492,7 +2492,11 @@
node1, node2 = ctx1.node(), ctx2.node()
if reverse:
- node1, node2 = node2, node1
+ ctxleft = ctx2
+ ctxright = ctx1
+ else:
+ ctxleft = ctx1
+ ctxright = ctx2
diffopts = patch.diffallopts(ui, opts)
m = scmutil.match(ctx2, pats, opts)
@@ -2502,8 +2506,8 @@
ui,
repo,
diffopts,
- repo[node1],
- repo[node2],
+ ctxleft,
+ ctxright,
m,
stat=stat,
listsubrepos=opts.get(b'subrepos'),
To: durin42, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200511/00f7957a/attachment-0002.html>
More information about the Mercurial-patches
mailing list