Mercurial > hg
annotate tests/test-config.t @ 35793:4fb2bb61597c
bundle2: increase payload part chunk size to 32kb
Bundle2 payload parts are framed chunks. Esentially, we obtain
data in equal size chunks of size `preferedchunksize` and emit those
to a generator. That generator is fed into a compressor (which can
be the no-op compressor, which just re-emits the generator). And
the output from the compressor likely goes to a file descriptor
or socket.
What this means is that small chunk sizes create more Python objects
and Python function calls than larger chunk sizes. And as we know,
Python object and function call overhead in performance sensitive
code matters (at least with CPython).
This commit increases the bundle2 part payload chunk size from 4k
to 32k. Practically speaking, this means that the chunks we feed
into a compressor (implemented in C code) or feed directly into a
file handle or socket write() are larger. It's possible the chunks
might be larger than what the receiver can handle in one logical
operation. But at that point, we're in C code, which is much more
efficient at dealing with splitting up the chunk and making multiple
function calls than Python is.
A downside to larger chunks is that the receiver has to wait for that
much data to arrive (either raw or from a decompressor) before it
can process the chunk. But 32kb still feels like a small buffer to
have to wait for. And in many cases, the client will convert from
8 read(4096) to 1 read(32768). That's happening in Python land. So
we cut down on the number of Python objects and function calls,
making the client faster as well. I don't think there are any
significant concerns to increasing the payload chunk size to 32kb.
The impact of this change on performance significant. Using `curl`
to obtain a stream clone bundle2 payload from a server on localhost
serving the mozilla-unified repository:
before: 20.78 user; 7.71 system; 80.5 MB/s
after: 13.90 user; 3.51 system; 132 MB/s
legacy: 9.72 user; 8.16 system; 132 MB/s
bundle2 stream clone generation is still more resource intensive than
legacy stream clone (that's likely because of the use of a
util.chunkbuffer). But the throughput is the same. We might
be in territory we're this is effectively a benchmark of the
networking stack or Python's syscall throughput.
From the client perspective, `hg clone -U --stream`:
before: 33.50 user; 7.95 system; 53.3 MB/s
after: 22.82 user; 7.33 system; 72.7 MB/s
legacy: 29.96 user; 7.94 system; 58.0 MB/s
And for `hg clone --stream` with a working directory update of
~230k files:
after: 119.55 user; 26.47 system; 0:57.08 wall
legacy: 126.98 user; 26.94 system; 1:05.56 wall
So, it appears that bundle2's stream clone is now definitively faster
than legacy stream clone!
Differential Revision: https://phab.mercurial-scm.org/D1932
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 20 Jan 2018 22:55:42 -0800 |
parents | 4441705b7111 |
children | a22915edc279 |
rev | line source |
---|---|
17015
73d20de5f30b
tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents:
12082
diff
changeset
|
1 hide outer repo |
73d20de5f30b
tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents:
12082
diff
changeset
|
2 $ hg init |
73d20de5f30b
tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents:
12082
diff
changeset
|
3 |
22275
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
4 Invalid syntax: no value |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
5 |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
6 $ cat > .hg/hgrc << EOF |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
7 > novaluekey |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
8 > EOF |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
9 $ hg showconfig |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
33329
diff
changeset
|
10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey |
22275
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
11 [255] |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
12 |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
13 Invalid syntax: no key |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
14 |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
15 $ cat > .hg/hgrc << EOF |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
16 > =nokeyvalue |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
17 > EOF |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
18 $ hg showconfig |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
33329
diff
changeset
|
19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue |
22275
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
20 [255] |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
21 |
22276
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
22 Test hint about invalid syntax from leading white space |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
23 |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
24 $ cat > .hg/hgrc << EOF |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
25 > key=value |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
26 > EOF |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
27 $ hg showconfig |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
33329
diff
changeset
|
28 hg: parse error at $TESTTMP/.hg/hgrc:1: key=value |
22276
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
29 unexpected leading whitespace |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
30 [255] |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
31 |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
32 $ cat > .hg/hgrc << EOF |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
33 > [section] |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
34 > key=value |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
35 > EOF |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
36 $ hg showconfig |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
33329
diff
changeset
|
37 hg: parse error at $TESTTMP/.hg/hgrc:1: [section] |
22276
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
38 unexpected leading whitespace |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
39 [255] |
b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Razvan Cojocaru <razvan.cojocaru93@gmail.com>
parents:
22275
diff
changeset
|
40 |
22275
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
41 Reset hgrc |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
42 |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
43 $ echo > .hg/hgrc |
d9a8017dce10
test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
19087
diff
changeset
|
44 |
19086
8fb8dce3f9b6
tests: rename from test-config-case.t to test-config.t for centralization
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17015
diff
changeset
|
45 Test case sensitive configuration |
8fb8dce3f9b6
tests: rename from test-config-case.t to test-config.t for centralization
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17015
diff
changeset
|
46 |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22367
diff
changeset
|
47 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22367
diff
changeset
|
48 > [Section] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22367
diff
changeset
|
49 > KeY = Case Sensitive |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22367
diff
changeset
|
50 > key = lower case |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22367
diff
changeset
|
51 > EOF |
3425
ec6f400cff4d
Use a case-sensitive version of SafeConfigParser everywhere
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
52 |
12082
5e2216a35839
tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents:
4528
diff
changeset
|
53 $ hg showconfig Section |
5e2216a35839
tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents:
4528
diff
changeset
|
54 Section.KeY=Case Sensitive |
5e2216a35839
tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents:
4528
diff
changeset
|
55 Section.key=lower case |
3425
ec6f400cff4d
Use a case-sensitive version of SafeConfigParser everywhere
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
56 |
29950
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
57 $ hg showconfig Section -Tjson |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
58 [ |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
59 { |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
60 "name": "Section.KeY", |
30986
f07ca071a058
runtests: set web.ipv6 if we use IPv6
Jun Wu <quark@fb.com>
parents:
30618
diff
changeset
|
61 "source": "*.hgrc:*", (glob) |
29950
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
62 "value": "Case Sensitive" |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
63 }, |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
64 { |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
65 "name": "Section.key", |
30986
f07ca071a058
runtests: set web.ipv6 if we use IPv6
Jun Wu <quark@fb.com>
parents:
30618
diff
changeset
|
66 "source": "*.hgrc:*", (glob) |
29950
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
67 "value": "lower case" |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
68 } |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
69 ] |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
70 $ hg showconfig Section.KeY -Tjson |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
71 [ |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
72 { |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
73 "name": "Section.KeY", |
30986
f07ca071a058
runtests: set web.ipv6 if we use IPv6
Jun Wu <quark@fb.com>
parents:
30618
diff
changeset
|
74 "source": "*.hgrc:*", (glob) |
29950
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
75 "value": "Case Sensitive" |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
76 } |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
77 ] |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
78 $ hg showconfig -Tjson | tail -7 |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
79 }, |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
80 { |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
81 "name": "*", (glob) |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
82 "source": "*", (glob) |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
83 "value": "*" (glob) |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
84 } |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
85 ] |
80fef5251099
config: add template support
Mathias De Maré <mathias.demare@gmail.com>
parents:
29412
diff
changeset
|
86 |
30618
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
87 Test empty config source: |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
88 |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
89 $ cat <<EOF > emptysource.py |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
90 > def reposetup(ui, repo): |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
91 > ui.setconfig('empty', 'source', 'value') |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
92 > EOF |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
93 $ cp .hg/hgrc .hg/hgrc.orig |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
94 $ cat <<EOF >> .hg/hgrc |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
95 > [extensions] |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
96 > emptysource = `pwd`/emptysource.py |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
97 > EOF |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
98 |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
99 $ hg config --debug empty.source |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
100 read config from: * (glob) |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
101 none: value |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
102 $ hg config empty.source -Tjson |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
103 [ |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
104 { |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
105 "name": "empty.source", |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
106 "source": "", |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
107 "value": "value" |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
108 } |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
109 ] |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
110 |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
111 $ cp .hg/hgrc.orig .hg/hgrc |
201b44c8875c
ui: do not translate empty configsource() to 'none' (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29950
diff
changeset
|
112 |
19087
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
113 Test "%unset" |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
114 |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
115 $ cat >> $HGRCPATH <<EOF |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
116 > [unsettest] |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
117 > local-hgrcpath = should be unset (HGRCPATH) |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
118 > %unset local-hgrcpath |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
119 > |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
120 > global = should be unset (HGRCPATH) |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
121 > |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
122 > both = should be unset (HGRCPATH) |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
123 > |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
124 > set-after-unset = should be unset (HGRCPATH) |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
125 > EOF |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
126 |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
127 $ cat >> .hg/hgrc <<EOF |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
128 > [unsettest] |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
129 > local-hgrc = should be unset (.hg/hgrc) |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
130 > %unset local-hgrc |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
131 > |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
132 > %unset global |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
133 > |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
134 > both = should be unset (.hg/hgrc) |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
135 > %unset both |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
136 > |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
137 > set-after-unset = should be unset (.hg/hgrc) |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
138 > %unset set-after-unset |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
139 > set-after-unset = should be set (.hg/hgrc) |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
140 > EOF |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
141 |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
142 $ hg showconfig unsettest |
7d82ad4b3727
config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19086
diff
changeset
|
143 unsettest.set-after-unset=should be set (.hg/hgrc) |
22316
816be4ca4ae2
config: exit non zero on non-existent config option (issue4247)
Aaron Kushner <akushner@fb.com>
parents:
19087
diff
changeset
|
144 |
816be4ca4ae2
config: exit non zero on non-existent config option (issue4247)
Aaron Kushner <akushner@fb.com>
parents:
19087
diff
changeset
|
145 Test exit code when no config matches |
816be4ca4ae2
config: exit non zero on non-existent config option (issue4247)
Aaron Kushner <akushner@fb.com>
parents:
19087
diff
changeset
|
146 |
816be4ca4ae2
config: exit non zero on non-existent config option (issue4247)
Aaron Kushner <akushner@fb.com>
parents:
19087
diff
changeset
|
147 $ hg config Section.idontexist |
816be4ca4ae2
config: exit non zero on non-existent config option (issue4247)
Aaron Kushner <akushner@fb.com>
parents:
19087
diff
changeset
|
148 [1] |
29412
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
149 |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
150 sub-options in [paths] aren't expanded |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
151 |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
152 $ cat > .hg/hgrc << EOF |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
153 > [paths] |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
154 > foo = ~/foo |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
155 > foo:suboption = ~/foo |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
156 > EOF |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
157 |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
158 $ hg showconfig paths |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
159 paths.foo:suboption=~/foo |
b62bce819d0c
ui: don't fixup [paths] sub-options
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23348
diff
changeset
|
160 paths.foo=$TESTTMP/foo |
31108
3f8f53190d6a
chg: deduplicate error handling of ui.system()
Yuya Nishihara <yuya@tcha.org>
parents:
30986
diff
changeset
|
161 |
3f8f53190d6a
chg: deduplicate error handling of ui.system()
Yuya Nishihara <yuya@tcha.org>
parents:
30986
diff
changeset
|
162 edit failure |
3f8f53190d6a
chg: deduplicate error handling of ui.system()
Yuya Nishihara <yuya@tcha.org>
parents:
30986
diff
changeset
|
163 |
3f8f53190d6a
chg: deduplicate error handling of ui.system()
Yuya Nishihara <yuya@tcha.org>
parents:
30986
diff
changeset
|
164 $ HGEDITOR=false hg config --edit |
3f8f53190d6a
chg: deduplicate error handling of ui.system()
Yuya Nishihara <yuya@tcha.org>
parents:
30986
diff
changeset
|
165 abort: edit failed: false exited with status 1 |
3f8f53190d6a
chg: deduplicate error handling of ui.system()
Yuya Nishihara <yuya@tcha.org>
parents:
30986
diff
changeset
|
166 [255] |
31685
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
167 |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
168 config affected by environment variables |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
169 |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
170 $ EDITOR=e1 VISUAL=e2 hg config --debug | grep 'ui\.editor' |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
171 $VISUAL: ui.editor=e2 |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
172 |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
173 $ VISUAL=e2 hg config --debug --config ui.editor=e3 | grep 'ui\.editor' |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
174 --config: ui.editor=e3 |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
175 |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
176 $ PAGER=p1 hg config --debug | grep 'pager\.pager' |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
177 $PAGER: pager.pager=p1 |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
178 |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
179 $ PAGER=p1 hg config --debug --config pager.pager=p2 | grep 'pager\.pager' |
d83e51654c8a
rcutil: let environ override system configs (BC)
Jun Wu <quark@fb.com>
parents:
31108
diff
changeset
|
180 --config: pager.pager=p2 |
33329
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
181 |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
182 verify that aliases are evaluated as well |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
183 |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
184 $ hg init aliastest |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
185 $ cd aliastest |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
186 $ cat > .hg/hgrc << EOF |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
187 > [ui] |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
188 > user = repo user |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
189 > EOF |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
190 $ touch index |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
191 $ unset HGUSER |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
192 $ hg ci -Am test |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
193 adding index |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
194 $ hg log --template '{author}\n' |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
195 repo user |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
196 $ cd .. |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
197 |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
198 alias has lower priority |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
199 |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
200 $ hg init aliaspriority |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
201 $ cd aliaspriority |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
202 $ cat > .hg/hgrc << EOF |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
203 > [ui] |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
204 > user = alias user |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
205 > username = repo user |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
206 > EOF |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
207 $ touch index |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
208 $ unset HGUSER |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
209 $ hg ci -Am test |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
210 adding index |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
211 $ hg log --template '{author}\n' |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
212 repo user |
e714159860fd
configitems: add alias support in config
David Demelier <demelier.david@gmail.com>
parents:
31685
diff
changeset
|
213 $ cd .. |