[issue2666] eol hook doesn't consider topology

Antoine Pitrou bugs at mercurial.selenic.com
Mon Feb 28 15:25:02 CST 2011


New submission from Antoine Pitrou <pitrou at free.fr>:

The eol hook doesn't consider topology and only checks files on the latest
changeset, even if some changesets in the changegroup aren't ancestors of
it. This means someone can commit a wrong line ending, then create another
head from a previous changeset and push the whole thing without eol noticing.

To reproduce the issue, apply the attached patch to test-eol-hook.t and run
it. It will fail thusly (IIUC, there is no point in posting this patch to
mercurial-devel since it doesn't include a fix :-)):


ERROR: /home/antoine/mercurial/tests/test-eol-hook.t output changed
--- /home/antoine/mercurial/tests/test-eol-hook.t 
+++ /home/antoine/mercurial/tests/test-eol-hook.t.err 
@@ -117,9 +117,4 @@
   adding changesets
   adding manifests
   adding file changes
-  added 2 changesets with 2 changes to 2 files
-  error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings
-  transaction abort!
-  rollback completed
-  abort: b.txt should not have CRLF line endings
-  [255]
+  added 2 changesets with 2 changes to 2 files (+1 heads)
!
Failed test-eol-hook.t: output changed

----------
messages: 15432
nosy: pitrou
priority: bug
status: unread
title: eol hook doesn't consider topology
topic: eol

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2666>
____________________________________________________


More information about the Mercurial-devel mailing list