comparison mercurial/copies.py @ 38669:b5891bf8ab13

copies: delete now-unnecessary check for "a == b" before "a.descendant(b)" Unnecessary since 879cbdde63df (revlog: do inclusive descendant testing (API), 2018-06-21). Differential Revision: https://phab.mercurial-scm.org/D3935
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Jul 2018 09:25:02 -0700
parents ee7b6fa52d9d
children fbec9c0b32d3
comparison
equal deleted inserted replaced
38668:21846c94e605 38669:b5891bf8ab13
414 # can be multiple common ancestors, e.g. in case of bidmerge. Because our 414 # can be multiple common ancestors, e.g. in case of bidmerge. Because our
415 # caller may not know if the revision passed in lieu of the CA is a genuine 415 # caller may not know if the revision passed in lieu of the CA is a genuine
416 # common ancestor or not without explicitly checking it, it's better to 416 # common ancestor or not without explicitly checking it, it's better to
417 # determine that here. 417 # determine that here.
418 # 418 #
419 # base.descendant(wc) and base.descendant(base) are False, work around that 419 # base.descendant(wc) is False, work around that
420 _c1 = c1.p1() if c1.rev() is None else c1 420 _c1 = c1.p1() if c1.rev() is None else c1
421 _c2 = c2.p1() if c2.rev() is None else c2 421 _c2 = c2.p1() if c2.rev() is None else c2
422 # an endpoint is "dirty" if it isn't a descendant of the merge base 422 # an endpoint is "dirty" if it isn't a descendant of the merge base
423 # if we have a dirty endpoint, we need to trigger graft logic, and also 423 # if we have a dirty endpoint, we need to trigger graft logic, and also
424 # keep track of which endpoint is dirty 424 # keep track of which endpoint is dirty
425 dirtyc1 = not (base == _c1 or base.descendant(_c1)) 425 dirtyc1 = not base.descendant(_c1)
426 dirtyc2 = not (base == _c2 or base.descendant(_c2)) 426 dirtyc2 = not base.descendant(_c2)
427 graft = dirtyc1 or dirtyc2 427 graft = dirtyc1 or dirtyc2
428 tca = base 428 tca = base
429 if graft: 429 if graft:
430 tca = _c1.ancestor(_c2) 430 tca = _c1.ancestor(_c2)
431 431