[PATCH RFC] convert: add support for recode in filemaps

Martin Geisler mg at lazybytes.net
Tue Dec 20 02:58:20 CST 2011


Matt Mackall <mpm at selenic.com> writes:

> On Mon, 2011-12-19 at 19:21 +0100, Martin Geisler wrote:
>> # HG changeset patch
>> # User Martin Geisler <mg at lazybytes.net>
>> # Date 1324318815 -3600
>> # Node ID 5bf6234ff33f997486c85210c6d7cec58f1fa524
>> # Parent  4841035f37b6df368682460d8a7cbf10276b8d1b
>> convert: add support for recode in filemaps
>> 
>> This command is used in a filemap like
>> 
>>   recode OLD NEW
>> 
>> and will make convert recode all file names from OLD to NEW.
>> 
>> This patch is not 100% done -- there could be a warning if recode is
>> specified twice, for example. Also, the recoding is done before
>> renames are taken into account. It should probably be done after since
>> the filemap seems to work on source path names only.
>
> This probably needs a way to specify an error-handling strategy. Right
> now it'll work great going to and from UTF-8 but elsewhere it'll be very
> hit or miss. As I read it, the default mode is: fail with a traceback.
> That default should probably be: replace with escaping of some sort. For
> instance, latin1 café to ascii caf%e9.

Yes, the missing error handling is an excellent point! I'll probably
update the patch later today.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- 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-devel/attachments/20111220/395181c5/attachment.pgp>


More information about the Mercurial-devel mailing list