Mercurial > public > mercurial-scm > hg
comparison mercurial/changelog.py @ 3771:29d91e57d055
Handle transcoding of username and description in changelog
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 03 Dec 2006 16:16:33 -0600 |
parents | f2de6b6bc57a |
children | abaee83ce0a6 f9bbcebcacea |
comparison
equal
deleted
inserted
replaced
3770:f96c158ea3a3 | 3771:29d91e57d055 |
---|---|
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), [], "", {}) |
63 last = text.index("\n\n") | 63 last = text.index("\n\n") |
64 desc = 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 = l[1] | 67 user = util.tolocal(l[1]) |
68 | 68 |
69 extra_data = l[2].split(' ', 2) | 69 extra_data = l[2].split(' ', 2) |
70 if len(extra_data) != 3: | 70 if len(extra_data) != 3: |
71 time = float(extra_data.pop(0)) | 71 time = float(extra_data.pop(0)) |
72 try: | 72 try: |
86 return self.extract(self.revision(node)) | 86 return self.extract(self.revision(node)) |
87 | 87 |
88 def add(self, manifest, list, desc, transaction, p1=None, p2=None, | 88 def add(self, manifest, list, desc, transaction, p1=None, p2=None, |
89 user=None, date=None, extra={}): | 89 user=None, date=None, extra={}): |
90 | 90 |
91 user, desc = util.fromlocal(user), util.fromlocal(desc) | |
92 | |
91 if date: | 93 if date: |
92 parseddate = "%d %d" % util.parsedate(date) | 94 parseddate = "%d %d" % util.parsedate(date) |
93 else: | 95 else: |
94 parseddate = "%d %d" % util.makedate() | 96 parseddate = "%d %d" % util.makedate() |
95 if extra: | 97 if extra: |