Mercurial > hg
annotate tests/test-diffstat @ 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 | 99a2096c3d8d |
children |
rev | line source |
---|---|
9640
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
1 #!/bin/sh |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
2 |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
3 hg init repo |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
4 cd repo |
9799
99a2096c3d8d
fix test-diffstat on solaris
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
9651
diff
changeset
|
5 i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done |
9640
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
6 hg add a |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
7 |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
8 echo '% wide diffstat' |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
9 hg diff --stat |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
10 |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
11 echo '% diffstat width' |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
12 COLUMNS=24 hg diff --config ui.interactive=true --stat |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
13 |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
14 hg ci -m adda |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
15 |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
16 cat >> a <<EOF |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
17 a |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
18 a |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
19 a |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
20 EOF |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
21 |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
22 echo '% narrow diffstat' |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
23 hg diff --stat |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
24 |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
25 hg ci -m appenda |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
26 |
9651
bd3af545c7c6
diffstat: made test case work with POSIX sh and printf
Yuya Nishihara <yuya@tcha.org>
parents:
9642
diff
changeset
|
27 printf '\0' > b |
9640
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
28 hg add b |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
29 |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
30 echo '% binary diffstat' |
9e76232fbfbe
diff: add --stat for diffstat output
Brodie Rao <me+hg@dackz.net>
parents:
diff
changeset
|
31 hg diff --stat |
9642
7d17794f08a9
diffstat: with --git, mark binary files with Bin
Brodie Rao <me+hg@dackz.net>
parents:
9640
diff
changeset
|
32 |
7d17794f08a9
diffstat: with --git, mark binary files with Bin
Brodie Rao <me+hg@dackz.net>
parents:
9640
diff
changeset
|
33 echo '% binary git diffstat' |
7d17794f08a9
diffstat: with --git, mark binary files with Bin
Brodie Rao <me+hg@dackz.net>
parents:
9640
diff
changeset
|
34 hg diff --stat --git |