Convert - correct EOL style
Martin Geisler
mg at lazybytes.net
Tue Jan 5 16:26:17 CST 2010
Stanimir Stamenkov <s7an10 at netscape.net> writes:
> I'm currently seeking whether it is possible to correct the EOL
> style of files when converting (either Subversion to Mercurial or
> Mercurial to Mercurial) repository, from the very first revision of
> the files. That is, initially they have been added without
> svn:eol-style=native property into a Subversion repo, then their EOL
> style got mixed-up and completely changed couple of times, which
> gives false impression the content being changed completely (couple
> of times).
>
> I have in .hgrc:
>
> [extensions]
> hgext.win32text =
>
> [hooks]
> pretxncommit.crlf = python:hgext.win32text.forbidcrlf
>
> [encode]
> ** = cleverencode:
>
> [decode]
> ** = cleverdecode:
>
> but seems the encoder doesn't work during conversion as the 'crlf'
> commit hook fails. Is it currently possible to correct the EOL
> style of files during repository conversion?
I'm pretty sure you cannot do this currently.
However, I believe you only need to hack getfile here:
http://selenic.com/hg/file/f5e55f1ca927/hgext/convert/subversion.py#l371
A simple
if not util.binary(data):
data = data.replace('\r\n', '\n')
before the data is returned should suffice.
--
Martin Geisler
VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial/attachments/20100105/302c7e52/attachment.pgp>
More information about the Mercurial
mailing list