Commits

Anonymous committed 4982e91

bug: parent[0] may not exist under certain circumstances

Comments (0)

Files changed (1)

         if date:
             fp.write('# Date %d %d\n' % date)
         parents = [p.node() for p in ctx.parents() if p]
-        fp.write('# Parent  %s\n' % hex(parents[0]))
+        if parents:
+            fp.write('# Parent  %s\n' % hex(parents[0]))
         if msg:
             if not isinstance(msg, str):
                 msg = '\n'.join(msg)