134 keys = d.keys() |
134 keys = d.keys() |
135 keys.sort() |
135 keys.sort() |
136 items = [_string_escape('%s:%s' % (k, d[k])) for k in keys] |
136 items = [_string_escape('%s:%s' % (k, d[k])) for k in keys] |
137 return "\0".join(items) |
137 return "\0".join(items) |
138 |
138 |
139 def extract(self, text): |
139 def read(self, node): |
140 """ |
140 """ |
141 format used: |
141 format used: |
142 nodeid\n : manifest node in ascii |
142 nodeid\n : manifest node in ascii |
143 user\n : user, no \n or \r allowed |
143 user\n : user, no \n or \r allowed |
144 time tz extra\n : date (time is int or float, timezone is int) |
144 time tz extra\n : date (time is int or float, timezone is int) |
147 files\n\n : files modified by the cset, no \n or \r allowed |
147 files\n\n : files modified by the cset, no \n or \r allowed |
148 (.*) : comment (free text, ideally utf-8) |
148 (.*) : comment (free text, ideally utf-8) |
149 |
149 |
150 changelog v0 doesn't use extra |
150 changelog v0 doesn't use extra |
151 """ |
151 """ |
|
152 text = self.revision(node) |
152 if not text: |
153 if not text: |
153 return (nullid, "", (0, 0), [], "", {'branch': 'default'}) |
154 return (nullid, "", (0, 0), [], "", {'branch': 'default'}) |
154 last = text.index("\n\n") |
155 last = text.index("\n\n") |
155 desc = util.tolocal(text[last + 2:]) |
156 desc = util.tolocal(text[last + 2:]) |
156 l = text[:last].split('\n') |
157 l = text[:last].split('\n') |
173 if not extra.get('branch'): |
174 if not extra.get('branch'): |
174 extra['branch'] = 'default' |
175 extra['branch'] = 'default' |
175 files = l[3:] |
176 files = l[3:] |
176 return (manifest, user, (time, timezone), files, desc, extra) |
177 return (manifest, user, (time, timezone), files, desc, extra) |
177 |
178 |
178 def read(self, node): |
|
179 return self.extract(self.revision(node)) |
|
180 |
|
181 def add(self, manifest, list, desc, transaction, p1=None, p2=None, |
179 def add(self, manifest, list, desc, transaction, p1=None, p2=None, |
182 user=None, date=None, extra={}): |
180 user=None, date=None, extra={}): |
183 |
181 |
184 user, desc = util.fromlocal(user), util.fromlocal(desc) |
182 user, desc = util.fromlocal(user), util.fromlocal(desc) |
185 |
183 |