diff mercurial/changelog.py @ 4176:f9bbcebcacea

"default" is the default branch name
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Tue, 13 Mar 2007 15:02:33 -0300
parents 29d91e57d055
children dbc3846c09a1
line wrap: on
line diff
--- a/mercurial/changelog.py	Sat Mar 10 17:36:29 2007 -0800
+++ b/mercurial/changelog.py	Tue Mar 13 15:02:33 2007 -0300
@@ -59,7 +59,7 @@
         changelog v0 doesn't use extra
         """
         if not text:
-            return (nullid, "", (0, 0), [], "", {})
+            return (nullid, "", (0, 0), [], "", {'branch': 'default'})
         last = text.index("\n\n")
         desc = util.tolocal(text[last + 2:])
         l = text[:last].split('\n')
@@ -79,6 +79,8 @@
             time, timezone, extra = extra_data
             time, timezone = float(time), int(timezone)
             extra = self.decode_extra(extra)
+        if not extra.get('branch'):
+            extra['branch'] = 'default'
         files = l[3:]
         return (manifest, user, (time, timezone), files, desc, extra)
 
@@ -94,6 +96,8 @@
             parseddate = "%d %d" % util.parsedate(date)
         else:
             parseddate = "%d %d" % util.makedate()
+        if extra and extra.get("branch") in ("default", ""):
+            del extra["branch"]
         if extra:
             extra = self.encode_extra(extra)
             parseddate = "%s %s" % (parseddate, extra)