Mercurial > public > mercurial-scm > hg
diff tests/test-eol-hook.t @ 13649:328ce8a405ac
eol: improve hook failure output
Before, only the first failure was reported:
abort: b.txt should not have CRLF line endings
while now all of them are listed:
abort: end-of-line check failed:
d.txt in a7040e68714f should not have CRLF line endings
b.txt in fbcf9b1025f5 should not have CRLF line endings
As first suggested by Antoine Pitrou <solipsis@pitrou.net>
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 14 Mar 2011 21:08:18 +0100 |
parents | 9cb1a42cd4b3 |
children | 7c26ce9edbd2 |
line wrap: on
line diff
--- a/tests/test-eol-hook.t Mon Mar 14 13:11:26 2011 -0500 +++ b/tests/test-eol-hook.t Mon Mar 14 21:08:18 2011 +0100 @@ -40,10 +40,12 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files - error: pretxnchangegroup hook failed: a.txt should not have CRLF line endings + error: pretxnchangegroup hook failed: end-of-line check failed: + a.txt in a8ee6548cd86 should not have CRLF line endings transaction abort! rollback completed - abort: a.txt should not have CRLF line endings + abort: end-of-line check failed: + a.txt in a8ee6548cd86 should not have CRLF line endings [255] $ printf "first\nsecond\nthird\n" > a.txt @@ -66,10 +68,12 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files - error: pretxnchangegroup hook failed: crlf.txt should not have LF line endings + error: pretxnchangegroup hook failed: end-of-line check failed: + crlf.txt in 004ba2132725 should not have LF line endings transaction abort! rollback completed - abort: crlf.txt should not have LF line endings + abort: end-of-line check failed: + crlf.txt in 004ba2132725 should not have LF line endings [255] $ printf "first\r\nsecond\r\nthird\r\n" > crlf.txt @@ -92,10 +96,12 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files - error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings + error: pretxnchangegroup hook failed: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed - abort: b.txt should not have CRLF line endings + abort: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings [255] $ hg up -r -2 @@ -111,10 +117,12 @@ adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) - error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings + error: pretxnchangegroup hook failed: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed - abort: b.txt should not have CRLF line endings + abort: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings [255] Test checkheadshook alias @@ -130,10 +138,12 @@ adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) - error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings + error: pretxnchangegroup hook failed: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed - abort: b.txt should not have CRLF line endings + abort: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings [255] We can fix the head and push again @@ -166,10 +176,12 @@ adding manifests adding file changes added 3 changesets with 3 changes to 2 files (+1 heads) - error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings + error: pretxnchangegroup hook failed: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed - abort: b.txt should not have CRLF line endings + abort: end-of-line check failed: + b.txt in fbcf9b1025f5 should not have CRLF line endings [255] But we can push the clean head @@ -182,3 +194,24 @@ adding file changes added 1 changesets with 1 changes to 1 files +Test multiple files/revisions output + + $ printf "another\r\nbad\r\none" > d.txt + $ hg add d.txt + $ hg ci -m "add d.txt" + $ hg push -f ../main + pushing to ../main + searching for changes + adding changesets + adding manifests + adding file changes + added 3 changesets with 3 changes to 2 files (+1 heads) + error: pretxnchangegroup hook failed: end-of-line check failed: + 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: + d.txt in a7040e68714f should not have CRLF line endings + b.txt in fbcf9b1025f5 should not have CRLF line endings + [255]