annotate tests/test-convert-bzr-treeroot.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 5abc47d4ca6b
children 26127236b229
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26066
89872688893f tests: move '#require bzr' into .t files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 16913
diff changeset
1 #require bzr
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
2
12517
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
3 $ . "$TESTDIR/bzr-definitions"
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
4 $ cat > treeset.py <<EOF
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
5 > import sys
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
6 > from bzrlib import workingtree
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
7 > wt = workingtree.WorkingTree.open('.')
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
8 >
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
9 > message, rootid = sys.argv[1:]
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
10 > wt.set_root_id('tree_root-%s' % rootid)
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
11 > wt.commit(message)
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
12 > EOF
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
13
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
14 change the id of the tree root
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
15
12517
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
16 $ mkdir test-change-treeroot-id
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
17 $ cd test-change-treeroot-id
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
18 $ bzr init -q source
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
19 $ cd source
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
20 $ echo content > file
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
21 $ bzr add -q file
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
22 $ bzr commit -q -m 'Initial add'
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 32940
diff changeset
23 $ "$PYTHON" ../../treeset.py 'Changed root' new
12517
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
24 $ cd ..
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
25 $ hg convert source source-hg
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
26 initializing destination source-hg repository
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
27 scanning source...
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
28 sorting...
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
29 converting...
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
30 1 Initial add
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
31 0 Changed root
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
32 $ manifest source-hg tip
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
33 % manifest of tip
cc8f1083e8be tests: unify test-convert-bzr-treeroot
Matt Mackall <mpm@selenic.com>
parents: 7058
diff changeset
34 644 file
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 12517
diff changeset
35
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 12517
diff changeset
36 $ cd ..