Mercurial > public > mercurial-scm > hg-stable
diff hgext/eol.py @ 27524:f5b6b4e574c1
eol: make output stable
This eliminates a divergence in behaviour between PyPy and Python.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Sun, 27 Dec 2015 23:55:54 +0900 |
parents | 56b2bcea2529 |
children | cca011fd1ea7 |
line wrap: on
line diff
--- 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))