]> thyrsus.com Git - src.git/commitdiff
Correct behavior from tip(). Regression test passes.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 12 Nov 2014 13:54:22 +0000 (08:54 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 12 Nov 2014 13:54:22 +0000 (08:54 -0500)
src

diff --git a/src b/src
index e288e3fb8d8604056ea67a751ed27118e48b20df..7d694360518015ebca8f79d2120fb33589216ca6 100755 (executable)
--- a/src
+++ b/src
@@ -213,9 +213,14 @@ class History:
             selection.reverse()
         return selection
     def tip(self):
-        "Return the latest revision in the repo."
-        # FIXME: should return the current branch tip.
-        return self.revlist[0]
+        "Return the tip revision of the current branch."
+        s = self.native_to_revno(self.current())
+        while True:
+            nxt = backend.succ(s, self)
+            if nxt is None:
+                return self.by_revno(s)
+            else:
+                s = nxt
     def native_to_revno(self, revision):
         "Map a native ID to a revno"
         for item in self.revlist: