Mercurial > hg
diff hgext/convert/git.py @ 8271:e3d3dad805f9
Add committer tag only when needed in git conversion
Convert from a git repo added a committer: tag in the log message
even if the committer and the author were the same person.
author | Richard Quirk <richard.quirk@gmail.com> |
---|---|
date | Fri, 01 May 2009 11:32:19 +0200 |
parents | 1b60efdb8bc5 |
children | e9e2a2c9b294 |
line wrap: on
line diff
--- a/hgext/convert/git.py Fri May 01 12:35:13 2009 +0200 +++ b/hgext/convert/git.py Fri May 01 11:32:19 2009 +0200 @@ -90,6 +90,7 @@ message = self.recode(message) l = c[:end].splitlines() parents = [] + author = committer = None for e in l[1:]: n, v = e.split(" ", 1) if n == "author": @@ -104,9 +105,10 @@ committer = " ".join(p[:-2]) if committer[0] == "<": committer = committer[1:-1] committer = self.recode(committer) - message += "\ncommitter: %s\n" % committer if n == "parent": parents.append(v) + if committer and committer != author: + message += "\ncommitter: %s\n" % committer tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:] tz = -int(tzs) * (int(tzh) * 3600 + int(tzm)) date = tm + " " + str(tz)