Mercurial > hg
view tests/test-git-import.out @ 12252:4481f8a93c7a stable
convert/darcs: handle non-ASCII metadata in darcs changelog (issue2354)
Given a commit author or message with non-ASCII characters in a darcs
repo, convert would raise a UnicodeEncodeError when adding changesets
to the hg changelog.
This happened because etree returns back unicode objects for any text
it can't encode into ASCII. convert was passing these objects to
changelog.add(), which would then attempt encoding.fromlocal() on
them.
This patch ensures converter_source.recode() is called on each piece
of commit data returned by etree.
(Also note that darcs is currently encoding agnostic and will print
out whatever is in a patch's metadata byte-for-byte, even in the XML
changelog.)
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Fri, 10 Sep 2010 09:30:50 -0500 |
parents | 377d879e9d1b |
children | 77600d697d0e |
line wrap: on
line source
% new file applying patch from stdin 0:ae3ee40d2079 % new empty file applying patch from stdin 1:ab199dc869b5 empty % chmod +x applying patch from stdin 2:3a34410f282e % copy applying patch from stdin 3:37bacb7ca14d a a % rename applying patch from stdin 4:47b81a94361d copyx empty new rename % delete applying patch from stdin 5:d9b001d98336 empty new rename % regular diff applying patch from stdin 6:ebe901e7576b % copy and modify applying patch from stdin 7:18f368958ecd a a b a a % rename and modify applying patch from stdin 8:c32b0d7e6f44 a a b c a % one file renamed multiple times applying patch from stdin 9:034a6bf95330 9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2) rename3 rename3-2 a a b c a a a b c a % binary files and regular patch hunks applying patch from stdin 11:c39bce63e786 foo 045c85ba38952325e126c70962cc0f9d9077bc67 644 binary % many binary files applying patch from stdin 12:30b530085242 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1 a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2 % filenames with spaces applying patch from stdin 13:04750ef42fb3 foo % copy then modify the original file applying patch from stdin 14:c4cd9cdeaa74 foo