Patchwork D3935: copies: delete now-unnecessary check for "a == b" before "a.descendant(b)"

login
register
mail settings
Submitter phabricator
Date July 13, 2018, 12:23 p.m.
Message ID <7b87945f17bd9e36f43c66d1cee61f21@localhost.localdomain>
Download mbox | patch
Permalink /patch/32828/
State Not Applicable
Headers show

Comments

phabricator - July 13, 2018, 12:23 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb5891bf8ab13: copies: delete now-unnecessary check for &quot;a == b&quot; before &quot;a.descendant(b)&quot; (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3935?vs=9571&id=9581

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

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -416,14 +416,14 @@ 
     # common ancestor or not without explicitly checking it, it's better to
     # determine that here.
     #
-    # base.descendant(wc) and base.descendant(base) are False, work around that
+    # base.descendant(wc) is False, work around that
     _c1 = c1.p1() if c1.rev() is None else c1
     _c2 = c2.p1() if c2.rev() is None else c2
     # an endpoint is "dirty" if it isn't a descendant of the merge base
     # if we have a dirty endpoint, we need to trigger graft logic, and also
     # keep track of which endpoint is dirty
-    dirtyc1 = not (base == _c1 or base.descendant(_c1))
-    dirtyc2 = not (base == _c2 or base.descendant(_c2))
+    dirtyc1 = not base.descendant(_c1)
+    dirtyc2 = not base.descendant(_c2)
     graft = dirtyc1 or dirtyc2
     tca = base
     if graft: