diff mercurial/localrepo.py @ 4167:4574a8cb080f

Store empty (default) branch in branch cache, too. Operations on this branch don't work otherwise. Reading branches.cache had to be adjusted to allow an empty label. Adjusted reading of the cache tip for symmetry, no functional change here.
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 09 Mar 2007 18:09:02 +0100
parents 43d8f7466920
children bbfe5a3fc80c
line wrap: on
line diff
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -376,7 +376,7 @@ class localrepository(repo.repository):
             f = self.opener("branches.cache")
             lines = f.read().split('\n')
             f.close()
-            last, lrev = lines.pop(0).rstrip().split(" ", 1)
+            last, lrev = lines.pop(0).split(" ", 1)
             last, lrev = bin(last), int(lrev)
             if not (lrev < self.changelog.count() and
                     self.changelog.node(lrev) == last): # sanity check
@@ -384,8 +384,8 @@ class localrepository(repo.repository):
                 raise ValueError('Invalid branch cache: unknown tip')
             for l in lines:
                 if not l: continue
-                node, label = l.rstrip().split(" ", 1)
-                partial[label] = bin(node)
+                node, label = l.split(" ", 1)
+                partial[label.strip()] = bin(node)
         except (KeyboardInterrupt, util.SignalInterrupt):
             raise
         except Exception, inst:
@@ -407,8 +407,7 @@ class localrepository(repo.repository):
         for r in xrange(start, end):
             c = self.changectx(r)
             b = c.branch()
-            if b:
-                partial[b] = c.node()
+            partial[b] = c.node()
 
     def lookup(self, key):
         if key == '.':