hgext/convert/cvsps.py
changeset 22267 90cf454edd70
parent 22202 684bad8c4265
child 24305 867c3649be5d
--- a/hgext/convert/cvsps.py	Sat Aug 16 17:59:26 2014 +0900
+++ b/hgext/convert/cvsps.py	Thu Aug 21 10:07:30 2014 -0400
@@ -631,7 +631,19 @@
                     odd.add((l, r))
                 d = -1
                 break
+        # By this point, the changesets are sufficiently compared that
+        # we don't really care about ordering. However, this leaves
+        # some race conditions in the tests, so we compare on the
+        # number of files modified and the number of branchpoints in
+        # each changeset to ensure test output remains stable.
 
+        # recommended replacement for cmp from
+        # https://docs.python.org/3.0/whatsnew/3.0.html
+        c = lambda x, y: (x > y) - (x < y)
+        if not d:
+            d = c(len(l.entries), len(r.entries))
+        if not d:
+            d = c(len(l.branchpoints), len(r.branchpoints))
         return d
 
     changesets.sort(cscmp)