hgext/convert/cvsps.py
changeset 38294 80f6e95fac2d
parent 37918 120c343c38b7
child 38295 bec815f991b0
--- a/hgext/convert/cvsps.py	Tue Jun 12 18:21:41 2018 -0400
+++ b/hgext/convert/cvsps.py	Tue Jun 12 18:24:25 2018 -0400
@@ -567,11 +567,15 @@
     mindate = {}
     for e in log:
         if e.commitid:
-            mindate[e.commitid] = min(e.date, mindate.get(e.commitid))
+            if e.commitid not in mindate:
+                mindate[e.commitid] = e.date
+            else:
+                mindate[e.commitid] = min(e.date, mindate[e.commitid])
 
     # Merge changesets
-    log.sort(key=lambda x: (mindate.get(x.commitid), x.commitid, x.comment,
-                            x.author, x.branch, x.date, x.branchpoints))
+    log.sort(key=lambda x: (mindate.get(x.commitid, (-1, 0)),
+                            x.commitid or '', x.comment,
+                            x.author, x.branch or '', x.date, x.branchpoints))
 
     changesets = []
     files = set()