changeset 17627:84f12b832ee8

bookmarks: use "changectx.descendant()" for efficient descendant examination This patch uses "old.descendant(new)" expression instead of "new in old.descendants()" for efficiency.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 18 Sep 2012 21:39:12 +0900
parents 3a524b647897
children 331d611813ec
files mercurial/bookmarks.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Tue Sep 18 21:39:12 2012 +0900
+++ b/mercurial/bookmarks.py	Tue Sep 18 21:39:12 2012 +0900
@@ -159,7 +159,7 @@
         if mark and marks[mark] in parents:
             old = repo[marks[mark]]
             new = repo[node]
-            if new in old.descendants() and mark == cur:
+            if old.descendant(new) and mark == cur:
                 marks[cur] = new.node()
                 update = True
             if mark != cur:
@@ -281,4 +281,4 @@
         validdests.remove(old)
         return new in validdests
     else:
-        return new in old.descendants()
+        return old.descendant(new)