Mercurial > hg
annotate tests/test-ui-config.py.out @ 26750:9f9ec4abe700
cmdutil: make in-memory changes visible to external editor (issue4378)
Before this patch, external editor process for the commit log can't
view some in-memory changes (especially, of dirstate), because they
aren't written out until the end of transaction (or wlock).
This causes unexpected output of Mercurial commands spawned from that
editor process.
To make in-memory changes visible to external editor process, this
patch does:
- write (or schedule to write) in-memory dirstate changes, and
- set HG_PENDING environment variable, if:
- a transaction is running, and
- there are in-memory changes to be visible
"hg diff" spawned from external editor process for "hg qrefresh"
shows:
- "changes newly imported into the topmost" before 49148d7868df(*)
- "all changes recorded in the topmost by refreshing" after this patch
(*) 49148d7868df changed steps invoking editor process
Even though backward compatibility may be broken, the latter behavior
looks reasonable, because "hg diff" spawned from the editor process
consistently shows "what changes new revision records" regardless of
invocation context.
In fact, issue4378 itself should be resolved by 800e090e9c64, which
made 'repo.transaction()' write in-memory dirstate changes out
explicitly before starting transaction. It also made "hg qrefresh"
imply 'dirstate.write()' before external editor invocation in call
chain below.
- mq.queue.refresh
- strip.strip
- repair.strip
- localrepository.transaction
- dirstate.write
- localrepository.commit
- invoke external editor
Though, this patch has '(issue4378)' in own summary line to indicate
that issues like issue4378 should be fixed by this.
BTW, this patch adds '-m' option to a 'hg ci --amend' execution in
'test-commit-amend.t', to avoid invoking external editor process.
In this case, "unsure" states may be changed to "clean" according to
timestamp or so on. These changes should be written into pending file,
if external editor invocation is required,
Then, writing dirstate changes out breaks stability of test, because
it shows "transaction abort!/rollback completed" occasionally.
Aborting after editor process invocation while commands below may
cause similar instability of tests, too (AFAIK, there is no more such
one, at this revision)
- commit --amend
- without --message/--logfile
- import
- without --message/--logfile,
- without --no-commit,
- without --bypass,
- one of below, and
- patch has no description text, or
- with --edit
- aborting at the 1st patch, which adds or removes file(s)
- if it only changes existing files, status is checked only for
changed files by 'scmutil.matchfiles()', and transition from
"unsure" to "normal" in dirstate doesn't occur (= dirstate
isn't changed, and written out)
- aborting at the 2nd or later patch implies other pending
changes (e.g. changelog), and always causes showing
"transaction abort!/rollback completed"
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 17 Oct 2015 01:15:34 +0900 |
parents | fa2b596db182 |
children | a6344df5108e |
rev | line source |
---|---|
14171
fa2b596db182
ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents:
11309
diff
changeset
|
1 [('string', 'string value'), ('bool1', 'true'), ('bool2', 'false'), ('boolinvalid', 'foo'), ('int1', '42'), ('int2', '-42'), ('intinvalid', 'foo')] |
11309
ef7636efeb01
ui: handle leading newlines/spaces/commas in configlist
Thomas Arendsen Hein <thomas@intevation.de>
parents:
10982
diff
changeset
|
2 [('list1', 'foo'), ('list2', 'foo bar baz'), ('list3', 'alice, bob'), ('list4', 'foo bar baz alice, bob'), ('list5', 'abc d"ef"g "hij def"'), ('list6', '"hello world", "how are you?"'), ('list7', 'Do"Not"Separate'), ('list8', '"Do"Separate'), ('list9', '"Do\\"NotSeparate"'), ('list10', 'string "with extraneous" quotation mark"'), ('list11', 'x, y'), ('list12', '"x", "y"'), ('list13', '""" key = "x", "y" """'), ('list14', ',,,, '), ('list15', '" just with starting quotation'), ('list16', '"longer quotation" with "no ending quotation'), ('list17', 'this is \\" "not a quotation mark"'), ('list18', '\n \n\nding\ndong')] |
2502
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
3 --- |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
4 'string value' |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
5 'true' |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
6 'false' |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
7 None |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
8 --- |
14171
fa2b596db182
ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents:
11309
diff
changeset
|
9 values.string is not a boolean ('string value') |
2502
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
10 True |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
11 False |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
12 False |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
13 False |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
14 True |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
15 --- |
14171
fa2b596db182
ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents:
11309
diff
changeset
|
16 42 |
fa2b596db182
ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents:
11309
diff
changeset
|
17 -42 |
fa2b596db182
ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents:
11309
diff
changeset
|
18 --- |
2502
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
19 ['foo'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
20 ['foo', 'bar', 'baz'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
21 ['alice', 'bob'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
22 ['foo', 'bar', 'baz', 'alice', 'bob'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
23 ['foo', 'bar', 'baz', 'alice', 'bob'] |
10982
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
24 ['abc', 'd"ef"g', 'hij def'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
25 ['hello world', 'how are you?'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
26 ['Do"Not"Separate'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
27 ['Do', 'Separate'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
28 ['Do"NotSeparate'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
29 ['string', 'with extraneous', 'quotation', 'mark"'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
30 ['x', 'y'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
31 ['x', 'y'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
32 ['', ' key = ', 'x"', 'y', '', '"'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
33 [] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
34 ['"', 'just', 'with', 'starting', 'quotation'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
35 ['longer quotation', 'with', '"no', 'ending', 'quotation'] |
0a548640e012
ui: support quotes in configlist (issue2147)
Henrik Stuart <hg@hstuart.dk>
parents:
8449
diff
changeset
|
36 ['this', 'is', '"', 'not a quotation mark'] |
11309
ef7636efeb01
ui: handle leading newlines/spaces/commas in configlist
Thomas Arendsen Hein <thomas@intevation.de>
parents:
10982
diff
changeset
|
37 ['ding', 'dong'] |
2502
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
38 [] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
39 [] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
40 ['foo'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
41 ['foo'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
42 ['foo', 'bar'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
43 ['foo', 'bar'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
44 ['foo bar'] |
18cf95ad3666
Allow using default values with ui.configlist, too, and add a test for this.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
45 ['foo', 'bar'] |
8144
fca54469480e
ui: introduce new config parser
Matt Mackall <mpm@selenic.com>
parents:
4729
diff
changeset
|
46 None |
fca54469480e
ui: introduce new config parser
Matt Mackall <mpm@selenic.com>
parents:
4729
diff
changeset
|
47 True |
14171
fa2b596db182
ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents:
11309
diff
changeset
|
48 boolinvalid |
fa2b596db182
ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents:
11309
diff
changeset
|
49 intinvalid |