]> thyrsus.com Git - src.git/commitdiff
Rewrite branch-to-base more cleanly. Regressuin test passes.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 11 Nov 2014 20:55:50 +0000 (15:55 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 11 Nov 2014 20:55:50 +0000 (15:55 -0500)
src

diff --git a/src b/src
index a2e1786b2caafdb2be6b6942e9fd26aa50716aaa..03e7b5089e9d81d2779790e30e2181433af5f772 100755 (executable)
--- a/src
+++ b/src
@@ -985,6 +985,9 @@ class RCS:
             if item.revision == rev:
                 return metadata[i].revno
         return None
+    def branch_to_base(self, revid):
+        "Go from a branch ID sticky tag to the revision it was based on."
+        return self.joinrev(self.splitrev(revid)[:-2])
     def add(self, arg):
         "Register a file"
         # Key choices here: -b suppresses all keyword expansion, -U sets
@@ -1158,9 +1161,6 @@ class RCS:
                 #print "\t%d revisions" % len(metadata.revlist)
                 print "\tlockrevs:", metadata.lockrevs
                 print "\tsymbols:", metadata.symbols
-    def branch_to_base(self, revid):
-        "Go from a branch ID sticky tag to the revision it was based on."
-        return ".".join(revid.split(".")[:-2])
 
 if __name__ == "__main__":
     try: