]> thyrsus.com Git - src.git/commitdiff
succ() and pred() are now only called when building links.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 15 Nov 2014 13:45:25 +0000 (08:45 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 15 Nov 2014 13:45:25 +0000 (08:45 -0500)
Regression test passes.

src

diff --git a/src b/src
index b4bd39a88809258043079941377c698cd5b551bb..206be549220841a9459f7aff01dcd51f375f465a 100755 (executable)
--- a/src
+++ b/src
@@ -214,23 +214,21 @@ class History:
     def current_branch(self, backwards=False):
         "Return a list of items that are descendants or ancestors of current."
         if debug >= DEBUG_SEQUENCE:
-            print "current_branch(%s)" % self.current().native
-        p = s = self.current().revno
-        selection = [self.by_revno(p)]
+            print "current_branch(%s)" % self.current()
+        p = self.current()
+        selection = [p]
         while True:
-            rev = self.revno_to_native(p)
-            rev = backend.pred(rev)
-            p = self.native_to_revno(rev)
-            if p is None:
+            if p.parent is None:
                 break
-            selection = [self.by_revno(p)] + selection
+            else:
+                p = p.parent
+            selection = [p] + selection
+        s = self.current()
         while True:
-            rev = self.revno_to_native(s)
-            rev = backend.succ(rev)
-            s = self.native_to_revno(rev)
+            s = s.child
             if s is None:
                 break
-            selection.append(self.by_revno(s))
+            selection.append(s)
         if backwards:
             selection.reverse()
         return selection