From eaf9f9706f3b3ef323cc65c4cb0cd868e26939f8 Mon Sep 17 00:00:00 2001 From: Dan Lenski Date: Mon, 19 Jan 2015 22:42:30 -0800 Subject: [PATCH] comment is optional --- wp2git.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp2git.py b/wp2git.py index 7ed5e75..a2286a6 100755 --- a/wp2git.py +++ b/wp2git.py @@ -91,9 +91,9 @@ def main(): text = rev.get('*','').encode('utf8') committer = '%s@%s' % (rev['user'].encode('utf8'), site.host[1]) ts = time.mktime(rev['timestamp']) - print((" >> Revision %d by %s at %s: %s" % (id, rev['user'], time.ctime(ts), rev['comment'])).encode('ascii','xmlcharrefreplace'), file=stderr) + print((" >> Revision %d by %s at %s: %s" % (id, rev.get('user',''), time.ctime(ts), rev['comment'])).encode('ascii','xmlcharrefreplace'), file=stderr) - summary = '%s\n\nURL: %s://%s%sindex.php?oldid=%d' % (rev['comment'].encode('utf8') or '', site.host[0], site.host[1], site.path, id) + summary = '%s\n\nURL: http://%s%sindex.php?oldid=%d' % (rev.get('comment','').encode('utf8') or '', site.host, site.path, id) fid.write('commit refs/heads/master\n') fid.write('committer <%s> %d +0000\n' % (committer, ts))