mercurial/changelog.py
changeset 4209 dbc3846c09a1
parent 3891 6b4127c7d52a
parent 4176 f9bbcebcacea
child 4257 1b5c38e9d7aa
--- a/mercurial/changelog.py	Tue Mar 13 21:54:34 2007 -0700
+++ b/mercurial/changelog.py	Wed Mar 14 01:26:09 2007 -0500
@@ -58,7 +58,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')
@@ -78,6 +78,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)
 
@@ -93,6 +95,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)