Mercurial > hg > hg-fastimport
changeset 16:234128693c29
Format the commit user as Full Name <user@example.com>
| author | Paul Aurich <paul@darkrain42.org> |
|---|---|
| date | Fri, 24 Apr 2009 19:46:17 -0700 |
| parents | e19d2ce18eeb |
| children | 0fa60b773da6 |
| files | fastimport/hgimport.py |
| diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/fastimport/hgimport.py Fri Apr 24 08:35:40 2009 -0700 +++ b/fastimport/hgimport.py Fri Apr 24 19:46:17 2009 -0700 @@ -126,10 +126,16 @@ commit_handler.process() #print "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" #self.ui.write(cmd.dump_str(verbose=True)) + + # in case we are converting from git or bzr, prefer author but + # fallback to committer (committer is required, author is + # optional) + userinfo = cmd.author or cmd.committer + user = "%s <%s>" % (userinfo[0], userinfo[1]) node = self.repo.rawcommit(files = commit_handler.filelist(), text = cmd.message, - user = cmd.committer[1], - date = self.convert_date(cmd.committer)) + user = user, + date = self.convert_date(userinfo)) rev = self.repo.changelog.rev(node) if cmd.mark is not None: self.mark_map[":" + cmd.mark] = rev
