tests/test-ui-config.py.out
author Manuel Jacob <me@manueljacob.de>
Mon, 11 Jul 2022 01:51:20 +0200
branchstable
changeset 49378 094a5fa3cf52
parent 37937 a2cfea193040
permissions -rw-r--r--
procutil: make stream detection in make_line_buffered more correct and strict In make_line_buffered(), we don’t want to wrap the stream if we know that lines get flushed to the underlying raw stream already. Previously, the heuristic was too optimistic. It assumed that any stream which is not an instance of io.BufferedIOBase doesn’t need wrapping. However, there are buffered streams that aren’t instances of io.BufferedIOBase, like Mercurial’s own winstdout. The new logic is different in two ways: First, only for the check, if unwraps any combination of WriteAllWrapper and winstdout. Second, it skips wrapping the stream only if it is an instance of io.RawIOBase (or already wrapped). If it is an instance of io.BufferedIOBase, it gets wrapped. In any other case, the function raises an exception. This ensures that, if an unknown stream is passed or we add another wrapper in the future, we don’t wrap the stream if it’s already line buffered or not wrap the stream if it’s not line buffered. In fact, this was already helpful during development of this change. Without it, I possibly would have forgot that WriteAllWrapper needs to be ignored for the check, leading to unnecessary wrapping if stdout is unbuffered. The alternative would have been to always wrap unknown streams. However, I don’t think that anyone would benefit from being less strict. We can expect streams from the standard library to be subclassing either io.RawIOBase or io.BufferedIOBase, so running Mercurial in the standard way should not regress by this change. Py2exe might replace sys.stdout and sys.stderr, but that currently breaks Mercurial anyway and also these streams don’t claim to be interactive, so this function is not called for them.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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')]
28081
a6344df5108e dispatch: strip command line options like config file options
Tony Tung <ttung@fb.com>
parents: 14171
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', 'ding\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
---
37937
a2cfea193040 tests: port test-ui-config to Python 3
Augie Fackler <augie@google.com>
parents: 32449
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']
32449
0ed730f3301c ui: fix ui.configdate for invalid dates
Boris Feld <boris.feld@octobus.net>
parents: 28081
diff changeset
    46
---
0ed730f3301c ui: fix ui.configdate for invalid dates
Boris Feld <boris.feld@octobus.net>
parents: 28081
diff changeset
    47
(0, 0)
0ed730f3301c ui: fix ui.configdate for invalid dates
Boris Feld <boris.feld@octobus.net>
parents: 28081
diff changeset
    48
(1113868800, 0)
8144
fca54469480e ui: introduce new config parser
Matt Mackall <mpm@selenic.com>
parents: 4729
diff changeset
    49
None
fca54469480e ui: introduce new config parser
Matt Mackall <mpm@selenic.com>
parents: 4729
diff changeset
    50
True
14171
fa2b596db182 ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents: 11309
diff changeset
    51
boolinvalid
fa2b596db182 ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents: 11309
diff changeset
    52
intinvalid
32449
0ed730f3301c ui: fix ui.configdate for invalid dates
Boris Feld <boris.feld@octobus.net>
parents: 28081
diff changeset
    53
dateinvalid