# HG changeset patch # User Bryan O'Sullivan # Date 1451228154 -32400 # Node ID f5b6b4e574c1323e5ef237149bac88aba05222f2 # Parent 68b9abf1cb82fa3932a698da89baa2ac316b6bc7 eol: make output stable This eliminates a divergence in behaviour between PyPy and Python. diff -r 68b9abf1cb82 -r f5b6b4e574c1 hgext/eol.py --- a/hgext/eol.py Wed Dec 23 12:32:08 2015 -0800 +++ b/hgext/eol.py Sun Dec 27 23:55:54 2015 +0900 @@ -201,7 +201,7 @@ data = ctx[f].data() if (target == "to-lf" and "\r\n" in data or target == "to-crlf" and singlelf.search(data)): - failed.append((str(ctx), target, f)) + failed.append((f, target, str(ctx))) break return failed @@ -244,7 +244,7 @@ if failed: eols = {'to-lf': 'CRLF', 'to-crlf': 'LF'} msgs = [] - for node, target, f in failed: + for f, target, node in sorted(failed): msgs.append(_(" %s in %s should not have %s line endings") % (f, node, eols[target])) raise error.Abort(_("end-of-line check failed:\n") + "\n".join(msgs)) diff -r 68b9abf1cb82 -r f5b6b4e574c1 tests/test-eol-hook.t --- a/tests/test-eol-hook.t Wed Dec 23 12:32:08 2015 -0800 +++ b/tests/test-eol-hook.t Sun Dec 27 23:55:54 2015 +0900 @@ -206,13 +206,13 @@ adding file changes added 3 changesets with 3 changes to 2 files (+1 heads) error: pretxnchangegroup hook failed: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings d.txt in a7040e68714f should not have CRLF line endings - b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed abort: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings d.txt in a7040e68714f should not have CRLF line endings - b.txt in fbcf9b1025f5 should not have CRLF line endings [255] $ cd ..