convert: use 'unknown' and '0 0' if commit author or date weren't specified
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Sun, 03 Feb 2008 21:03:46 -0200
changeset 5984 9451a941c536
parent 5983 6f1fcbc58efa
child 5985 850494d62674
convert: use 'unknown' and '0 0' if commit author or date weren't specified Closes issue873.
hgext/convert/common.py
hgext/convert/git.py
--- a/hgext/convert/common.py	Sun Feb 03 21:03:46 2008 -0200
+++ b/hgext/convert/common.py	Sun Feb 03 21:03:46 2008 -0200
@@ -22,8 +22,8 @@
 class commit(object):
     def __init__(self, author, date, desc, parents, branch=None, rev=None,
                  extra={}):
-        self.author = author
-        self.date = date
+        self.author = author or 'unknown'
+        self.date = date or '0 0'
         self.desc = desc
         self.parents = parents
         self.branch = branch
--- a/hgext/convert/git.py	Sun Feb 03 21:03:46 2008 -0200
+++ b/hgext/convert/git.py	Sun Feb 03 21:03:46 2008 -0200
@@ -99,7 +99,6 @@
         tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
         tz = -int(tzs) * (int(tzh) * 3600 + int(tzm))
         date = tm + " " + str(tz)
-        author = author or "unknown"
 
         c = commit(parents=parents, date=date, author=author, desc=message,
                    rev=version)