tests/test-propertycache.py
author Robert Stanca <robert.stanca7@gmail.com>
Mon, 04 Apr 2016 04:56:05 +0300
changeset 28762 61ba04ae6a2f
parent 28755 84673a7c54af
child 28838 a9a8b3f29544
permissions -rw-r--r--
py3: use print_function in test-propertycache.py
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
"""test behavior of propertycache and unfiltered propertycache
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
19951
d51c4d85ec23 spelling: random spell checker fixes
Mads Kiilerich <madski@unity3d.com>
parents: 19878
diff changeset
     3
The repoview overlay is quite complex. We test the behavior of
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
property cache of both localrepo and repoview to prevent
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
regression."""
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
     7
from __future__ import absolute_import, print_function
28755
84673a7c54af py3: use absolute_import in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 21024
diff changeset
     8
import os
84673a7c54af py3: use absolute_import in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 21024
diff changeset
     9
import subprocess
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
import mercurial.localrepo
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    11
import mercurial.repoview
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
import mercurial.util
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
import mercurial.hg
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
import mercurial.ui as uimod
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
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
# create some special property cache that trace they call
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
calllog = []
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
@mercurial.util.propertycache
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
def testcachedfoobar(repo):
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
    name = repo.filtername
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
    if name is None:
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
        name = ''
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
    val = len(name)
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
    calllog.append(val)
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
    return val
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    29
unficalllog = []
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    30
@mercurial.localrepo.unfilteredpropertycache
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    31
def testcachedunfifoobar(repo):
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    32
    name = repo.filtername
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    33
    if name is None:
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    34
        name = ''
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    35
    val = 100 + len(name)
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    36
    unficalllog.append(val)
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    37
    return val
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    38
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    39
#plug them on repo
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    40
mercurial.localrepo.localrepository.testcachedfoobar = testcachedfoobar
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
    41
mercurial.localrepo.localrepository.testcachedunfifoobar = testcachedunfifoobar
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
21024
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 19951
diff changeset
    44
# Create an empty repo and instantiate it. It is important to run
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 19951
diff changeset
    45
# these tests on the real object to detect regression.
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    46
repopath = os.path.join(os.environ['TESTTMP'], 'repo')
19878
21de61bc2ab5 test: make test-propertycache.py python2.4 compatible
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19846
diff changeset
    47
assert subprocess.call(['hg', 'init', repopath]) == 0
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    48
ui = uimod.ui()
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
repo = mercurial.hg.repository(ui, path=repopath).unfiltered()
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    50
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    52
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    53
print('=== property cache ===')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    54
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    55
print('calllog:', calllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    56
print('cached value (unfiltered):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    57
    vars(repo).get('testcachedfoobar', 'NOCACHE'))
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    59
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    60
print('= first access on unfiltered, should do a call')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    61
print('access:', repo.testcachedfoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    62
print('calllog:', calllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    63
print('cached value (unfiltered):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    64
    vars(repo).get('testcachedfoobar', 'NOCACHE'))
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    65
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    66
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    67
print('= second access on unfiltered, should not do call')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    68
print('access', repo.testcachedfoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    69
print('calllog:', calllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    70
print('cached value (unfiltered):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    71
    vars(repo).get('testcachedfoobar', 'NOCACHE'))
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    73
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    74
print('= first access on "visible" view, should do a call')
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    75
visibleview = repo.filtered('visible')
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    76
print('cached value ("visible" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    77
    vars(visibleview).get('testcachedfoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    78
print('access:', visibleview.testcachedfoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    79
print('calllog:', calllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    80
print('cached value (unfiltered):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    81
    vars(repo).get('testcachedfoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    82
print('cached value ("visible" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    83
    vars(visibleview).get('testcachedfoobar', 'NOCACHE'))
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    84
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    85
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    86
print('= second access on "visible view", should not do call')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    87
print('access:', visibleview.testcachedfoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    88
print('calllog:', calllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    89
print('cached value (unfiltered):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    90
    vars(repo).get('testcachedfoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    91
print('cached value ("visible" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    92
    vars(visibleview).get('testcachedfoobar', 'NOCACHE'))
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    93
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    94
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    95
print('= no effect on other view')
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    96
immutableview = repo.filtered('immutable')
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    97
print('cached value ("immutable" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    98
    vars(immutableview).get('testcachedfoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
    99
print('access:', immutableview.testcachedfoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   100
print('calllog:', calllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   101
print('cached value (unfiltered):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   102
    vars(repo).get('testcachedfoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   103
print('cached value ("visible" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   104
    vars(visibleview).get('testcachedfoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   105
print('cached value ("immutable" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   106
    vars(immutableview).get('testcachedfoobar', 'NOCACHE'))
19845
a1237a4b437d repoview: make propertycache.setcache compatible with repoview
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   107
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
   108
# unfiltered property cache test
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   109
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   110
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   111
print('=== unfiltered property cache ===')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   112
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   113
print('unficalllog:', unficalllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   114
print('cached value (unfiltered):      ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   115
    vars(repo).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   116
print('cached value ("visible" view):  ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   117
    vars(visibleview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   118
print('cached value ("immutable" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   119
    vars(immutableview).get('testcachedunfifoobar', 'NOCACHE'))
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
   120
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   121
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   122
print('= first access on unfiltered, should do a call')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   123
print('access (unfiltered):', repo.testcachedunfifoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   124
print('unficalllog:', unficalllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   125
print('cached value (unfiltered):      ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   126
    vars(repo).get('testcachedunfifoobar', 'NOCACHE'))
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
   127
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   128
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   129
print('= second access on unfiltered, should not do call')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   130
print('access (unfiltered):', repo.testcachedunfifoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   131
print('unficalllog:', unficalllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   132
print('cached value (unfiltered):      ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   133
    vars(repo).get('testcachedunfifoobar', 'NOCACHE'))
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
   134
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   135
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   136
print('= access on view should use the unfiltered cache')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   137
print('access (unfiltered):      ', repo.testcachedunfifoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   138
print('access ("visible" view):  ', visibleview.testcachedunfifoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   139
print('access ("immutable" view):', immutableview.testcachedunfifoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   140
print('unficalllog:', unficalllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   141
print('cached value (unfiltered):      ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   142
    vars(repo).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   143
print('cached value ("visible" view):  ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   144
    vars(visibleview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   145
print('cached value ("immutable" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   146
    vars(immutableview).get('testcachedunfifoobar', 'NOCACHE'))
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
   147
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   148
print('')
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   149
print('= even if we clear the unfiltered cache')
19846
9789670992d6 repoview: have unfilteredpropertycache using the underlying cache
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19845
diff changeset
   150
del repo.__dict__['testcachedunfifoobar']
28762
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   151
print('cached value (unfiltered):      ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   152
    vars(repo).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   153
print('cached value ("visible" view):  ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   154
    vars(visibleview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   155
print('cached value ("immutable" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   156
    vars(immutableview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   157
print('unficalllog:', unficalllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   158
print('access ("visible" view):  ', visibleview.testcachedunfifoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   159
print('unficalllog:', unficalllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   160
print('cached value (unfiltered):      ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   161
    vars(repo).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   162
print('cached value ("visible" view):  ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   163
    vars(visibleview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   164
print('cached value ("immutable" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   165
    vars(immutableview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   166
print('access ("immutable" view):', immutableview.testcachedunfifoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   167
print('unficalllog:', unficalllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   168
print('cached value (unfiltered):      ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   169
    vars(repo).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   170
print('cached value ("visible" view):  ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   171
    vars(visibleview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   172
print('cached value ("immutable" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   173
    vars(immutableview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   174
print('access (unfiltered):      ', repo.testcachedunfifoobar)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   175
print('unficalllog:', unficalllog)
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   176
print('cached value (unfiltered):      ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   177
    vars(repo).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   178
print('cached value ("visible" view):  ',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   179
    vars(visibleview).get('testcachedunfifoobar', 'NOCACHE'))
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   180
print('cached value ("immutable" view):',
61ba04ae6a2f py3: use print_function in test-propertycache.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28755
diff changeset
   181
    vars(immutableview).get('testcachedunfifoobar', 'NOCACHE'))