--- a/hgext/convert/cvsps.py Fri Mar 13 17:55:04 2015 -0500
+++ b/hgext/convert/cvsps.py Fri Mar 13 14:20:13 2015 -0400
@@ -634,14 +634,21 @@
# 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.
+ # number of files modified, the files contained in each
+ # changeset, and the branchpoints in the change 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)
+ # Sort bigger changes first.
if not d:
d = c(len(l.entries), len(r.entries))
+ # Try sorting by filename in the change.
+ if not d:
+ d = c([e.file for e in l.entries], [e.file for e in r.entries])
+ # Try and put changes without a branch point before ones with
+ # a branch point.
if not d:
d = c(len(l.branchpoints), len(r.branchpoints))
return d