Mercurial > hg
annotate tests/test-histedit-merge-tools.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 | 15d2afa31e57 |
children | 5effb1992c17 |
rev | line source |
---|---|
42052
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
1 Test histedit extension: Merge tools |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
2 ==================================== |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
3 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
4 Initialization |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
5 --------------- |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
6 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
7 $ . "$TESTDIR/histedit-helpers.sh" |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
8 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
9 $ cat >> $HGRCPATH <<EOF |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
10 > [alias] |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
11 > logt = log --template '{rev}:{node|short} {desc|firstline}\n' |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
12 > [extensions] |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
13 > histedit= |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
14 > mockmakedate = $TESTDIR/mockmakedate.py |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
15 > [ui] |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
16 > pre-merge-tool-output-template='pre-merge message for {node}\n' |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
17 > EOF |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
18 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
19 Merge conflict |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
20 -------------- |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
21 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
22 $ hg init r |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
23 $ cd r |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
24 $ echo foo > file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
25 $ hg add file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
26 $ hg ci -m "First" -d "1 0" |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
27 $ echo bar > file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
28 $ hg ci -m "Second" -d "2 0" |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
29 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
30 $ hg logt --graph |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
31 @ 1:2aa920f62fb9 Second |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
32 | |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
33 o 0:7181f42b8fca First |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
34 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
35 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
36 Invert the order of the commits, but fail the merge. |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
37 $ hg histedit --config ui.merge=false --commands - 2>&1 <<EOF | fixbundle |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
38 > pick 2aa920f62fb9 Second |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
39 > pick 7181f42b8fca First |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
40 > EOF |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
41 merging file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
42 pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
43 merging file failed! |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
44 Fix up the change (pick 7181f42b8fca) |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
45 (hg histedit --continue to resume) |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
46 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
47 $ hg histedit --abort | fixbundle |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
49 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
50 Invert the order of the commits, and pretend the merge succeeded. |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
51 $ hg histedit --config ui.merge=true --commands - 2>&1 <<EOF | fixbundle |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
52 > pick 2aa920f62fb9 Second |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
53 > pick 7181f42b8fca First |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
54 > EOF |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
55 merging file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
56 pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
57 7181f42b8fca: skipping changeset (no changes) |