[PATCH] eol: hook should consider all changegroup heads (issue2666)

Martin Geisler mg at aragost.com
Tue Mar 1 10:20:24 CST 2011


Antoine Pitrou <solipsis at pitrou.net> writes:

> # HG changeset patch
> # User Antoine Pitrou <solipsis at pitrou.net>
> # Date 1298968929 -3600
> # Branch stable
> # Node ID b9101359e4b0b0e218cb4508518d909dd86fb266
> # Parent  4f5f54314720a20f58ce6167937496368b889330
> eol: hook should consider all changegroup heads (issue2666)
>
> If the eol hook only considers the tipmost changeset in the
> changegroup, it is possible to first check in a file with a
> bogus line ending, then create another head from a previous
> changeset, and push the whole bunch without eol noticing.
> By considering all heads in the changegroup, we fix this issue.

I was just about to push this, but then I changed my mind... I wrote
this to Antoine on IRC:

Hi again -- I just convinced myself that the patch to make eol.hook
check all heads is wrong. We cannot use the encode/decode filters found
in the current ui since they are read from tip they should be read from
the .hgeol file in each head to be correct

The same goes for the allcsethook patch.

I suggest we wait with these patches until after the release and then
refactor the eol extension heavily -- the readhgeol method should be a
function so that the hook(s) can call it to read the .hgeol file from
whatever revision they like without setting global state.

Does that sound okay?

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/en/services/mercurial/blog/


More information about the Mercurial-devel mailing list