Patchwork D5592: copies: use node.wdirrev instead of inventing another constant for it

login
register
mail settings
Submitter phabricator
Date Jan. 16, 2019, 8:07 a.m.
Message ID <0c1f14790f85b708401c70bc6b76c72b@localhost.localdomain>
Download mbox | patch
Permalink /patch/37779/
State Not Applicable
Headers show

Comments

phabricator - Jan. 16, 2019, 8:07 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe3e1b0639375: copies: use node.wdirrev instead of inventing another constant for it (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5592?vs=13230&id=13241

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

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -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)