annotate tests/test-bookmarks-strip @ 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 2313dc4d9817
children 741290486877
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7316
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
1 #!/bin/sh
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
2
11208
2313dc4d9817 tests: fix bashism to load helpers.sh
Yuya Nishihara <yuya@tcha.org>
parents: 11200
diff changeset
3 . $TESTDIR/helpers.sh
7316
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
4 echo "[extensions]" >> $HGRCPATH
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
5 echo "bookmarks=" >> $HGRCPATH
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
6 echo "mq=" >> $HGRCPATH
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
7
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
8 hg init
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
9
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
10 echo qqq>qqq.txt
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
11
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
12 echo % add file
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
13 hg add
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
14
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
15 echo % commit first revision
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
16 hg ci -m 1 -u user -d "1 0"
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
17
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
18 echo % set bookmark
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
19 hg book test
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
20
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
21 echo www>>qqq.txt
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
22
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
23 echo % commit second revision
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
24 hg ci -m 2 -u usr -d "1 0"
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
25
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
26 echo % set bookmark
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
27 hg book test2
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
28
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
29 echo % update to -2
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
30 hg update -r -2
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
31
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
32 echo eee>>qqq.txt
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
33
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
34 echo % commit new head
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
35 hg ci -m 3 -u user -d "1 0"
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
36
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
37 echo % bookmarks updated?
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
38 hg book
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
39
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
40 echo % strip to revision 1
11200
12e5149cafca strip: improve full backup message
Matt Mackall <mpm@selenic.com>
parents: 7316
diff changeset
41 hg strip 1 | hidebackup
7316
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
42
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
43 echo % list bookmarks
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
44 hg book
9737041646bc bookmarks: Use dirstate to determine the current node in addchangegroup
David Soria Parra <dsp@php.net>
parents:
diff changeset
45