annotate tests/test-journal-exists.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 e96ed3a61899
children 7a4e1d245f19
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
1 $ hg init
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
2 $ echo a > a
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
3 $ hg ci -Am0
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
4 adding a
5865
e7127f669edb transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
5
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
6 $ hg -q clone . foo
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
7
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
8 $ touch .hg/store/journal
5865
e7127f669edb transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
9
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
10 $ echo foo > a
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
11 $ hg ci -Am0
21274
3b4c75690206 journal: set Abort hint when failing due to an abandoned transaction
Johan Bjork <jbjoerk@gmail.com>
parents: 20008
diff changeset
12 abort: abandoned transaction found!
3b4c75690206 journal: set Abort hint when failing due to an abandoned transaction
Johan Bjork <jbjoerk@gmail.com>
parents: 20008
diff changeset
13 (run 'hg recover' to clean up transaction)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12205
diff changeset
14 [255]
5865
e7127f669edb transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
15
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
16 $ hg recover
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
17 rolling back interrupted transaction
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
18 checking changesets
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
19 checking manifests
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
20 crosschecking files in changesets and manifests
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
21 checking files
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 21274
diff changeset
22 checked 1 changesets with 1 changes to 1 files
5865
e7127f669edb transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
23
44134
e96ed3a61899 recover: fix typos
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 42144
diff changeset
24 recover, explicit verify
42144
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
25
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
26 $ touch .hg/store/journal
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
27 $ hg ci -Am0
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
28 abort: abandoned transaction found!
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
29 (run 'hg recover' to clean up transaction)
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
30 [255]
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
31 $ hg recover --verify
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
32 rolling back interrupted transaction
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
33 checking changesets
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
34 checking manifests
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
35 crosschecking files in changesets and manifests
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
36 checking files
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
37 checked 1 changesets with 1 changes to 1 files
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
38
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
39 recover, no verify
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
40
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
41 $ touch .hg/store/journal
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
42 $ hg ci -Am0
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
43 abort: abandoned transaction found!
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
44 (run 'hg recover' to clean up transaction)
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
45 [255]
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
46 $ hg recover --no-verify
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
47 rolling back interrupted transaction
44134
e96ed3a61899 recover: fix typos
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 42144
diff changeset
48 (verify step skipped, run `hg verify` to check your repository content)
42144
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
49
013de80bf90e recover: add a --[no-]verify flag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41420
diff changeset
50
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
51 Check that zero-size journals are correctly aborted:
9693
c40a1ee20aa5 transaction: always remove empty journal on abort
Sune Foldager <cryo@cyanite.org>
parents: 5867
diff changeset
52
20008
e54a078153f7 tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents: 16959
diff changeset
53 #if unix-permissions no-root
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
54 $ hg bundle -qa repo.hg
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
55 $ chmod -w foo/.hg/store/00changelog.i
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
56
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
57 $ hg -R foo unbundle repo.hg
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
58 adding changesets
41420
b6673e9bdcf6 dispatch: quote filename in IOError as well
Yuya Nishihara <yuya@tcha.org>
parents: 39489
diff changeset
59 abort: Permission denied: '$TESTTMP/foo/.hg/store/.00changelog.i-*' (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12205
diff changeset
60 [255]
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
61
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
62 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
16959
acba1281e064 test-journal-exists: use #if
Adrian Buehlmann <adrian@cadifra.com>
parents: 15443
diff changeset
63 #endif
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
64