Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
4175:fc12ac3755d5 | 4176:f9bbcebcacea |
---|---|
57 (.*) : comment (free text, ideally utf-8) | 57 (.*) : comment (free text, ideally utf-8) |
58 | 58 |
59 changelog v0 doesn't use extra | 59 changelog v0 doesn't use extra |
60 """ | 60 """ |
61 if not text: | 61 if not text: |
62 return (nullid, "", (0, 0), [], "", {}) | 62 return (nullid, "", (0, 0), [], "", {'branch': 'default'}) |
63 last = text.index("\n\n") | 63 last = text.index("\n\n") |
64 desc = util.tolocal(text[last + 2:]) | 64 desc = util.tolocal(text[last + 2:]) |
65 l = text[:last].split('\n') | 65 l = text[:last].split('\n') |
66 manifest = bin(l[0]) | 66 manifest = bin(l[0]) |
67 user = util.tolocal(l[1]) | 67 user = util.tolocal(l[1]) |
77 extra = {} | 77 extra = {} |
78 else: | 78 else: |
79 time, timezone, extra = extra_data | 79 time, timezone, extra = extra_data |
80 time, timezone = float(time), int(timezone) | 80 time, timezone = float(time), int(timezone) |
81 extra = self.decode_extra(extra) | 81 extra = self.decode_extra(extra) |
82 if not extra.get('branch'): | |
83 extra['branch'] = 'default' | |
82 files = l[3:] | 84 files = l[3:] |
83 return (manifest, user, (time, timezone), files, desc, extra) | 85 return (manifest, user, (time, timezone), files, desc, extra) |
84 | 86 |
85 def read(self, node): | 87 def read(self, node): |
86 return self.extract(self.revision(node)) | 88 return self.extract(self.revision(node)) |
92 | 94 |
93 if date: | 95 if date: |
94 parseddate = "%d %d" % util.parsedate(date) | 96 parseddate = "%d %d" % util.parsedate(date) |
95 else: | 97 else: |
96 parseddate = "%d %d" % util.makedate() | 98 parseddate = "%d %d" % util.makedate() |
99 if extra and extra.get("branch") in ("default", ""): | |
100 del extra["branch"] | |
97 if extra: | 101 if extra: |
98 extra = self.encode_extra(extra) | 102 extra = self.encode_extra(extra) |
99 parseddate = "%s %s" % (parseddate, extra) | 103 parseddate = "%s %s" % (parseddate, extra) |
100 list.sort() | 104 list.sort() |
101 l = [hex(manifest), user, parseddate] + list + ["", desc] | 105 l = [hex(manifest), user, parseddate] + list + ["", desc] |