##// END OF EJS Templates
context: rename descendant() to isancestorof()...
Martin von Zweigbergk -
r38692:fbec9c0b default
parent child Browse files
Show More
@@ -813,7 +813,7 b' def validdest(repo, old, new):'
813 return new.node() in obsutil.foreground(repo, [old.node()])
813 return new.node() in obsutil.foreground(repo, [old.node()])
814 else:
814 else:
815 # still an independent clause as it is lazier (and therefore faster)
815 # still an independent clause as it is lazier (and therefore faster)
816 return old.descendant(new)
816 return old.isancestorof(new)
817
817
818 def checkformat(repo, mark):
818 def checkformat(repo, mark):
819 """return a valid version of a potential bookmark name
819 """return a valid version of a potential bookmark name
@@ -589,8 +589,8 b' class changectx(basectx):'
589 short(n) for n in sorted(cahs) if n != anc))
589 short(n) for n in sorted(cahs) if n != anc))
590 return changectx(self._repo, anc)
590 return changectx(self._repo, anc)
591
591
592 def descendant(self, other):
592 def isancestorof(self, other):
593 """True if other is descendant of this changeset"""
593 """True if this changeset is an ancestor of other"""
594 return self._repo.changelog.isancestorrev(self._rev, other._rev)
594 return self._repo.changelog.isancestorrev(self._rev, other._rev)
595
595
596 def walk(self, match):
596 def walk(self, match):
@@ -416,14 +416,14 b' def _fullcopytracing(repo, c1, c2, base)'
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) is False, work around that
419 # base.isancestorof(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.descendant(_c1)
425 dirtyc1 = not base.isancestorof(_c1)
426 dirtyc2 = not base.descendant(_c2)
426 dirtyc2 = not base.isancestorof(_c2)
427 graft = dirtyc1 or dirtyc2
427 graft = dirtyc1 or dirtyc2
428 tca = base
428 tca = base
429 if graft:
429 if graft:
General Comments 0
You need to be logged in to leave comments. Login now