Mercurial > hg
annotate tests/test-sparse-requirement.t @ 44261:04a3ae7aba14
chg: force-set LC_CTYPE on server start to actual value from the environment
Python 3.7+ will "coerce" the LC_CTYPE variable in many instances, and this can
cause issues with chg being able to start up. D7550 attempted to fix this, but a
combination of a misreading of the way that python3.7 does the coercion and an
untested state (LC_CTYPE being set to an invalid value) meant that this was
still not quite working.
This change will cause differences between chg and hg: hg will have the LC_CTYPE
environment variable coerced, while chg will not. This is unlikely to cause any
detectable behavior differences in what Mercurial itself outputs, but it does
have two known effects:
- When using hg, the coerced LC_CTYPE will be passed to subprocesses, even
non-python ones. Using chg will remove the coercion, and this will not
happen. This is arguably more correct behavior on chg's part.
- On macOS, if you set your region to Brazil but your language to English,
this isn't representable in locale strings, so macOS sets LC_CTYPE=UTF-8. If
this value is passed along when ssh'ing to a non-macOS machine, some
functions (such as locale.setlocale()) may raise an exception due to an
unsupported locale setting. This is most easily encountered when doing an
interactive commit/split/etc. when using ui.interface=curses.
Differential Revision: https://phab.mercurial-scm.org/D8039
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Wed, 29 Jan 2020 13:39:50 -0800 |
parents | a0886a4d6dce |
children | 5c2a4f37eace |
rev | line source |
---|---|
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 $ hg init repo |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 $ cd repo |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 $ touch a.html b.html c.py d.py |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 $ cat > frontend.sparse << EOF |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 > [include] |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 > *.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 > EOF |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 $ hg -q commit -A -m initial |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 $ echo 1 > a.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 $ echo 1 > c.py |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 $ hg commit -m 'commit 1' |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 Enable sparse profile |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 $ cat .hg/requires |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 dotencode |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 fncache |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 generaldelta |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 revlogv1 |
40907
74a519c86625
test: enable sparse-revlog for test-sparse-requirement.t
Boris Feld <boris.feld@octobus.net>
parents:
37415
diff
changeset
|
24 sparserevlog |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 store |
37415
c2c8962a9465
simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33556
diff
changeset
|
26 testonly-simplestore (reposimplestore !) |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 $ hg debugsparse --config extensions.sparse= --enable-profile frontend.sparse |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 $ ls |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
30 a.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
31 b.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 Requirement for sparse added when sparse is enabled |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 $ cat .hg/requires |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 dotencode |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
37 exp-sparse |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 fncache |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
39 generaldelta |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 revlogv1 |
40907
74a519c86625
test: enable sparse-revlog for test-sparse-requirement.t
Boris Feld <boris.feld@octobus.net>
parents:
37415
diff
changeset
|
41 sparserevlog |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
42 store |
37415
c2c8962a9465
simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33556
diff
changeset
|
43 testonly-simplestore (reposimplestore !) |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 Client without sparse enabled reacts properly |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
47 $ hg files |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
48 abort: repository is using sparse feature but sparse is not enabled; enable the "sparse" extensions to access! |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 [255] |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
51 Requirement for sparse is removed when sparse is disabled |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
52 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
53 $ hg debugsparse --reset --config extensions.sparse= |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
54 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
55 $ cat .hg/requires |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
56 dotencode |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
57 fncache |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
58 generaldelta |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
59 revlogv1 |
40907
74a519c86625
test: enable sparse-revlog for test-sparse-requirement.t
Boris Feld <boris.feld@octobus.net>
parents:
37415
diff
changeset
|
60 sparserevlog |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
61 store |
37415
c2c8962a9465
simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33556
diff
changeset
|
62 testonly-simplestore (reposimplestore !) |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
63 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
64 And client without sparse can access |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
65 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
66 $ hg files |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
67 a.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
68 b.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
69 c.py |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
70 d.py |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
71 frontend.sparse |