changeset 41231:e3e1b0639375

copies: use node.wdirrev instead of inventing another constant for it Differential Revision: https://phab.mercurial-scm.org/D5592
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 15 Jan 2019 09:20:47 -0800
parents d2d716cc0700
children f3f5bfbf7e04
files mercurial/copies.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Sat Dec 29 23:35:05 2018 -0800
+++ b/mercurial/copies.py	Tue Jan 15 09:20:47 2019 -0800
@@ -46,22 +46,21 @@
     #   - quit when interesting revs is zero
 
     cl = repo.changelog
-    working = len(cl) # pseudo rev for the working directory
     if a is None:
-        a = working
+        a = node.wdirrev
     if b is None:
-        b = working
+        b = node.wdirrev
 
     side = {a: -1, b: 1}
     visit = [-a, -b]
     heapq.heapify(visit)
     interesting = len(visit)
     hascommonancestor = False
-    limit = working
+    limit = node.wdirrev
 
     while interesting:
         r = -heapq.heappop(visit)
-        if r == working:
+        if r == node.wdirrev:
             parents = [cl.rev(p) for p in repo.dirstate.parents()]
         else:
             parents = cl.parentrevs(r)