tests/test-propertycache.py.out
author Manuel Jacob <me@manueljacob.de>
Mon, 11 Jul 2022 01:51:20 +0200
branchstable
changeset 49378 094a5fa3cf52
parent 19846 9789670992d6
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:
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
=== property cache ===
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
calllog: []
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
cached value (unfiltered): NOCACHE
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
= first access on unfiltered, should do a call
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     8
access: 0
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     9
calllog: [0]
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
cached value (unfiltered): 0
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    11
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
= second access on unfiltered, should not do call
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
access 0
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
calllog: [0]
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
cached value (unfiltered): 0
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
= first access on "visible" view, should do a call
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
cached value ("visible" view): NOCACHE
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
access: 7
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
calllog: [0, 7]
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
cached value (unfiltered): 0
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
cached value ("visible" view): 7
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
= second access on "visible view", should not do call
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
access: 7
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
calllog: [0, 7]
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
cached value (unfiltered): 0
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
cached value ("visible" view): 7
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
= no effect on other view
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
cached value ("immutable" view): NOCACHE
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
access: 9
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    33
calllog: [0, 7, 9]
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
cached value (unfiltered): 0
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    35
cached value ("visible" view): 7
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
cached value ("immutable" view): 9
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    37
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    38
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    39
=== unfiltered property cache ===
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    40
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    41
unficalllog: []
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    42
cached value (unfiltered):       NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    43
cached value ("visible" view):   NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    44
cached value ("immutable" view): NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    45
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    46
= first access on unfiltered, should do a call
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    47
access (unfiltered): 100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    48
unficalllog: [100]
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    49
cached value (unfiltered):       100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    50
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    51
= second access on unfiltered, should not do call
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    52
access (unfiltered): 100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    53
unficalllog: [100]
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    54
cached value (unfiltered):       100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    55
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    56
= access on view should use the unfiltered cache
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    57
access (unfiltered):       100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    58
access ("visible" view):   100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    59
access ("immutable" view): 100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    60
unficalllog: [100]
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    61
cached value (unfiltered):       100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    62
cached value ("visible" view):   NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    63
cached value ("immutable" view): NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    64
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    65
= even if we clear the unfiltered cache
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    66
cached value (unfiltered):       NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    67
cached value ("visible" view):   NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    68
cached value ("immutable" view): NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    69
unficalllog: [100]
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    70
access ("visible" view):   100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    71
unficalllog: [100, 100]
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    72
cached value (unfiltered):       100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    73
cached value ("visible" view):   NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    74
cached value ("immutable" view): NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    75
access ("immutable" view): 100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    76
unficalllog: [100, 100]
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    77
cached value (unfiltered):       100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    78
cached value ("visible" view):   NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    79
cached value ("immutable" view): NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    80
access (unfiltered):       100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    81
unficalllog: [100, 100]
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    82
cached value (unfiltered):       100
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    83
cached value ("visible" view):   NOCACHE
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    84
cached value ("immutable" view): NOCACHE