annotate tests/test-encoding-align.t @ 36755:ff4bc0ab6740 stable

wireproto: check permissions when executing "batch" command (BC) (SEC) For as long as the "batch" command has existed (introduced by bd88561afb4b and first released as part of Mercurial 1.9), that command (like most wire commands introduced after 2008) lacked an entry in the hgweb permissions table. And since we don't verify permissions if an entry is missing from the permissions table, this meant that executing a command via "batch" would bypass all permissions checks. The security implications are significant: a Mercurial HTTP server would allow writes via "batch" wire protocol commands as long as the HTTP request were processed by Mercurial and the process running the Mercurial HTTP server had write access to the repository. The Mercurial defaults of servers being read-only and the various web.* config options to define access control were bypassed. In addition, "batch" could be used to exfiltrate data from servers that were configured to not allow read access. Both forms of permissions bypass could be mitigated to some extent by using HTTP authentication. This would prevent HTTP requests from hitting Mercurial's server logic. However, any authenticated request would still be able to bypass permissions checks via "batch" commands. The easiest exploit was to send "pushkey" commands via "batch" and modify the state of bookmarks, phases, and obsolescence markers. However, I suspect a well-crafted HTTP request could trick the server into running the "unbundle" wire protocol command, effectively performing a full `hg push` to create new changesets on the remote. This commit plugs this gaping security hole by having the "batch" command perform permissions checking on each sub-command that is being batched. We do this by threading a permissions checking callable all the way to the protocol handler. The threading is a bit hacky from a code perspective. But it preserves API compatibility, which is the proper thing to do on the stable branch. One of the subtle things we do is assume that a command with an undefined permission is a "push" command. This is the safest thing to do from a security perspective: we don't want to take chances that a command could perform a write even though the server is configured to not allow writes. As the test changes demonstrate, it is no longer possible to bypass permissions via the "batch" wire protocol command. .. bc:: The "batch" wire protocol command now enforces permissions of each invoked sub-command. Wire protocol commands must define their operation type or the "batch" command will assume they can write data and will prevent their execution on HTTP servers unless the HTTP request method is POST, the server is configured to allow pushes, and the (possibly authenticated) HTTP user is authorized to perform a push.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 20 Feb 2018 18:55:58 -0800
parents 8e6f4939a69a
children af9cb761b5f3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
1 Test alignment of multibyte characters
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
2
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
3 $ HGENCODING=utf-8
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
4 $ export HGENCODING
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
5 $ hg init t
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
6 $ cd t
33262
8e6f4939a69a tests: replace yet more calls to `python` with $PYTHON
Augie Fackler <augie@google.com>
parents: 33097
diff changeset
7 $ $PYTHON << EOF
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
8 > # (byte, width) = (6, 4)
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
9 > s = "\xe7\x9f\xad\xe5\x90\x8d"
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
10 > # (byte, width) = (7, 7): odd width is good for alignment test
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
11 > m = "MIDDLE_"
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
12 > # (byte, width) = (18, 12)
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
13 > l = "\xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d"
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
14 > f = file('s', 'w'); f.write(s); f.close()
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
15 > f = file('m', 'w'); f.write(m); f.close()
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
16 > f = file('l', 'w'); f.write(l); f.close()
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
17 > # instant extension to show list of options
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
18 > f = file('showoptlist.py', 'w'); f.write("""# encoding: utf-8
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
19 > from mercurial import registrar
21254
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17837
diff changeset
20 > cmdtable = {}
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
21 > command = registrar.command(cmdtable)
21254
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17837
diff changeset
22 >
33097
fce4ed2912bb py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
23 > @command(b'showoptlist',
21254
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17837
diff changeset
24 > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'),
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17837
diff changeset
25 > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'),
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17837
diff changeset
26 > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s')],
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17837
diff changeset
27 > '')
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
28 > def showoptlist(ui, repo, *pats, **opts):
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
29 > '''dummy command to show option descriptions'''
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
30 > return 0
15031
0cb27eda3a1e util: wrap lines with multi-byte characters correctly (issue2943)
Mads Kiilerich <mads@kiilerich.com>
parents: 12941
diff changeset
31 > """ % globals())
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
32 > f.close()
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
33 > EOF
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
34 $ S=`cat s`
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
35 $ M=`cat m`
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
36 $ L=`cat l`
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
37
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
38 alignment of option descriptions in help
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
39
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
40 $ cat <<EOF > .hg/hgrc
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
41 > [extensions]
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
42 > ja_ext = `pwd`/showoptlist.py
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
43 > EOF
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
44
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
45 check alignment of option descriptions in help
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
46
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
47 $ hg help showoptlist
15203
c7ce651a6bc9 help: generate command help into a single RST string for formatting
Matt Mackall <mpm@selenic.com>
parents: 15202
diff changeset
48 hg showoptlist
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
49
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
50 dummy command to show option descriptions
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
51
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
52 options:
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
53
15145
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 15066
diff changeset
54 -s --opt1 \xe7\x9f\xad\xe5\x90\x8d short width \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d (esc)
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 15066
diff changeset
55 -m --opt2 MIDDLE_ middle width MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 15066
diff changeset
56 MIDDLE_ MIDDLE_ MIDDLE_
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 15066
diff changeset
57 -l --opt3 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d long width \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc)
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 15066
diff changeset
58 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc)
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 15066
diff changeset
59 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc)
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
60
22110
26f7c8033bed help: tweak --verbose command help hint
Matt Mackall <mpm@selenic.com>
parents: 21585
diff changeset
61 (some details hidden, use --verbose to show complete help)
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
62
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
63
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
64 $ rm -f s; touch s
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
65 $ rm -f m; touch m
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
66 $ rm -f l; touch l
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
67
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
68 add files
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
69
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
70 $ cp s $S
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
71 $ hg add $S
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
72 $ cp m $M
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
73 $ hg add $M
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
74 $ cp l $L
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
75 $ hg add $L
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
76
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
77 commit(1)
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
78
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
79 $ echo 'first line(1)' >> s; cp s $S
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
80 $ echo 'first line(2)' >> m; cp m $M
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
81 $ echo 'first line(3)' >> l; cp l $L
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
82 $ hg commit -m 'first commit' -u $S
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
83
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
84 commit(2)
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
85
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
86 $ echo 'second line(1)' >> s; cp s $S
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
87 $ echo 'second line(2)' >> m; cp m $M
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
88 $ echo 'second line(3)' >> l; cp l $L
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
89 $ hg commit -m 'second commit' -u $M
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
90
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
91 commit(3)
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
92
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
93 $ echo 'third line(1)' >> s; cp s $S
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
94 $ echo 'third line(2)' >> m; cp m $M
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
95 $ echo 'third line(3)' >> l; cp l $L
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
96 $ hg commit -m 'third commit' -u $L
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
97
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
98 check alignment of user names in annotate
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
99
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
100 $ hg annotate -u $M
12941
b911cb80c671 tests: use (esc) markup for string-escape
Mads Kiilerich <mads@kiilerich.com>
parents: 12722
diff changeset
101 \xe7\x9f\xad\xe5\x90\x8d: first line(2) (esc)
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
102 MIDDLE_: second line(2)
12941
b911cb80c671 tests: use (esc) markup for string-escape
Mads Kiilerich <mads@kiilerich.com>
parents: 12722
diff changeset
103 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d: third line(2) (esc)
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
104
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
105 check alignment of filenames in diffstat
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
106
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
107 $ hg diff -c tip --stat
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
108 MIDDLE_ | 1 +
12941
b911cb80c671 tests: use (esc) markup for string-escape
Mads Kiilerich <mads@kiilerich.com>
parents: 12722
diff changeset
109 \xe7\x9f\xad\xe5\x90\x8d | 1 + (esc)
b911cb80c671 tests: use (esc) markup for string-escape
Mads Kiilerich <mads@kiilerich.com>
parents: 12722
diff changeset
110 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d | 1 + (esc)
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
111 3 files changed, 3 insertions(+), 0 deletions(-)
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
112
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
113 add branches/tags
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
114
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
115 $ hg branch $S
12941
b911cb80c671 tests: use (esc) markup for string-escape
Mads Kiilerich <mads@kiilerich.com>
parents: 12722
diff changeset
116 marked working directory as branch \xe7\x9f\xad\xe5\x90\x8d (esc)
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 15203
diff changeset
117 (branches are permanent and global, did you want a bookmark?)
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
118 $ hg tag $S
21571
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
119 $ hg book -f $S
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
120 $ hg branch $M
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
121 marked working directory as branch MIDDLE_
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
122 $ hg tag $M
21571
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
123 $ hg book -f $M
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
124 $ hg branch $L
12941
b911cb80c671 tests: use (esc) markup for string-escape
Mads Kiilerich <mads@kiilerich.com>
parents: 12722
diff changeset
125 marked working directory as branch \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc)
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
126 $ hg tag $L
21571
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
127 $ hg book -f $L
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
128
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
129 check alignment of branches
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
130
21570
d0ec3800101a tests: fix cut and paste error on encoding alignment test
Matt Mackall <mpm@selenic.com>
parents: 17837
diff changeset
131 $ hg branches
d0ec3800101a tests: fix cut and paste error on encoding alignment test
Matt Mackall <mpm@selenic.com>
parents: 17837
diff changeset
132 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 5:d745ff46155b (esc)
d0ec3800101a tests: fix cut and paste error on encoding alignment test
Matt Mackall <mpm@selenic.com>
parents: 17837
diff changeset
133 MIDDLE_ 4:9259be597f19 (inactive)
d0ec3800101a tests: fix cut and paste error on encoding alignment test
Matt Mackall <mpm@selenic.com>
parents: 17837
diff changeset
134 \xe7\x9f\xad\xe5\x90\x8d 3:b06c5b6def9e (inactive) (esc)
d0ec3800101a tests: fix cut and paste error on encoding alignment test
Matt Mackall <mpm@selenic.com>
parents: 17837
diff changeset
135 default 2:64a70663cee8 (inactive)
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
136
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
137 check alignment of tags
11611
4f5a6df2af92 i18n: use encoding.colwidth() for correct column width
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff changeset
138
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
139 $ hg tags
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
140 tip 5:d745ff46155b
12941
b911cb80c671 tests: use (esc) markup for string-escape
Mads Kiilerich <mads@kiilerich.com>
parents: 12722
diff changeset
141 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 4:9259be597f19 (esc)
12418
09c6dd129f82 tests: unify test-encoding-align
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
142 MIDDLE_ 3:b06c5b6def9e
12941
b911cb80c671 tests: use (esc) markup for string-escape
Mads Kiilerich <mads@kiilerich.com>
parents: 12722
diff changeset
143 \xe7\x9f\xad\xe5\x90\x8d 2:64a70663cee8 (esc)
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15615
diff changeset
144
21571
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
145 check alignment of bookmarks
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
146
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
147 $ hg book
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
148 MIDDLE_ 5:d745ff46155b
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
149 \xe7\x9f\xad\xe5\x90\x8d 4:9259be597f19 (esc)
17da326fd041 bookmarks: properly align multi-byte characters
Matt Mackall <mpm@selenic.com>
parents: 21570
diff changeset
150 * \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 5:d745ff46155b (esc)