Mercurial > hg
view tests/test-archive.out @ 11297:d320e70442a5
replace Python standard textwrap by MBCS sensitive one for i18n text
Mercurial has problem around text wrapping/filling in MBCS encoding
environment, because standard 'textwrap' module of Python can not
treat it correctly. It splits byte sequence for one character into two
lines.
According to unicode specification, "east asian width" classifies
characters into:
W(ide), N(arrow), F(ull-width), H(alf-width), A(mbiguous)
W/N/F/H can be always recognized as 2/1/2/1 bytes in byte sequence,
but 'A' can not. Size of 'A' depends on language in which it is used.
Unicode specification says:
If the context(= language) cannot be established reliably they
should be treated as narrow characters by default
but many of class 'A' characters are full-width, at least, in Japanese
environment.
So, this patch treats class 'A' characters as full-width always for
safety wrapping.
This patch focuses only on MBCS safe-ness, not on writing/printing
rule strict wrapping for each languages
MBCS sensitive textwrap class is originally implemented
by ITO Nobuaki <daydream.trippers@gmail.com>.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 06 Jun 2010 17:20:10 +0900 |
parents | 9ea7238ad935 |
children | 381f131220ad |
line wrap: on
line source
adding foo adding bar adding baz/bletch % gz allowed should give 200 200 Script output follows % tar.bz2 and zip disallowed should both give 403 403 Archive type not allowed: bz2 403 Archive type not allowed: zip % bz2 allowed should give 200 200 Script output follows % zip and tar.gz disallowed should both give 403 403 Archive type not allowed: zip 403 Archive type not allowed: gz % zip allowed should give 200 200 Script output follows % tar.gz and tar.bz2 disallowed should both give 403 403 Archive type not allowed: gz 403 Archive type not allowed: bz2 % invalid arch type should give 404 404 Unsupported archive type: None test-archive-TIP/.hg_archival.txt test-archive-TIP/bar test-archive-TIP/baz/bletch test-archive-TIP/foo test-archive-TIP/.hg_archival.txt test-archive-TIP/bar test-archive-TIP/baz/bletch test-archive-TIP/foo Archive: archive.zip testing: test-archive-TIP/.hg_archival.txt OK testing: test-archive-TIP/bar OK testing: test-archive-TIP/baz/bletch OK testing: test-archive-TIP/foo OK No errors detected in compressed data of archive.zip. test/.hg_archival.txt test/bar test/baz/bletch test/foo test/.hg_archival.txt test/bar test/foo test-TIP/.hg_archival.txt test-TIP/bar test-TIP/baz/bletch test-TIP/foo autodetected_test/.hg_archival.txt autodetected_test/bar autodetected_test/baz/bletch autodetected_test/foo autodetect_override_test.zip/.hg_archival.txt autodetect_override_test.zip/bar autodetect_override_test.zip/baz/bletch autodetect_override_test.zip/foo True abort: archive prefix contains illegal components Archive: test.zip testing: test/bar OK testing: test/baz/bletch OK testing: test/foo OK No errors detected in compressed data of test.zip. test-TIP/.hg_archival.txt test-TIP/bar test-TIP/baz/bletch test-TIP/foo rev-0.tar created % test .hg_archival.txt repo: daa7f7c60e0a224faa4ff77ca41b2760562af264 node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e branch: default latesttag: null latesttagdistance: 3 repo: daa7f7c60e0a224faa4ff77ca41b2760562af264 node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e branch: default tag: anothertag tag: mytag abort: unknown archive type 'bogus' % server errors % empty repo abort: no working directory: please specify a revision