tests/test-demandimport.py.out
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 05 Apr 2018 16:31:45 -0700
changeset 37443 65250a66b55c
parent 36251 c2c5f9f6fa21
child 37964 1d0610fdd63b
permissions -rw-r--r--
revlog: move censor logic into main revlog class Previously, the revlog class implemented dummy methods for various censor-related functionality. Revision censoring was (and will continue to be) only possible on filelog instances. So filelog implemented these methods to perform something reasonable. A problem with implementing censoring on filelog is that it assumes filelog is a revlog. Upcoming work to formalize the filelog interface will make this not true. Furthermore, the censoring logic is security-sensitive. I think action-at-a-distance with custom implementation of core revlog APIs in derived classes is a bit dangerous. I think at a minimum the censor logic should live in revlog.py. I was tempted to created a "censored revlog" class that basically pulled these methods out of filelog. But, I wasn't a huge fan of overriding core methods in child classes. A reason to do that would be performance. However, the censoring code only comes into play when: * hash verification fails * delta generation * applying deltas from changegroups The new code is conditional on an instance attribute. So the overhead for running the censored code when the revlog isn't censorable is an attribute lookup. All of these operations are at least a magnitude slower than a Python attribute lookup. So there shouldn't be a performance concern. Differential Revision: https://phab.mercurial-scm.org/D3151
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36237
b39f0fdb0338 tests: actually check that HGDEMANDIMPORT=disable disables demandimport
Martin von Zweigbergk <martinvonz@google.com>
parents: 32448
diff changeset
     1
node = <module 'mercurial.node' from '?'>
36251
c2c5f9f6fa21 tests: avoid referring to pvec in demandimport test
Martin von Zweigbergk <martinvonz@google.com>
parents: 36237
diff changeset
     2
errorproxy = <unloaded module 'error'>
c2c5f9f6fa21 tests: avoid referring to pvec in demandimport test
Martin von Zweigbergk <martinvonz@google.com>
parents: 36237
diff changeset
     3
errorproxy.__doc__ = 'Mercurial exceptions. This ...'
c2c5f9f6fa21 tests: avoid referring to pvec in demandimport test
Martin von Zweigbergk <martinvonz@google.com>
parents: 36237
diff changeset
     4
errorproxy.__name__ = 'mercurial.error'
c2c5f9f6fa21 tests: avoid referring to pvec in demandimport test
Martin von Zweigbergk <martinvonz@google.com>
parents: 36237
diff changeset
     5
errorproxy.__dict__['__name__'] = 'mercurial.error'
c2c5f9f6fa21 tests: avoid referring to pvec in demandimport test
Martin von Zweigbergk <martinvonz@google.com>
parents: 36237
diff changeset
     6
errorproxy = <proxied module 'error'>
4631
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     7
os = <unloaded module 'os'>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     8
os.system = <built-in function system>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     9
os = <module 'os' from '?'>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    10
util = <unloaded module 'util'>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    11
util.system = <function system at 0x?>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    12
util = <module 'mercurial.util' from '?'>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    13
util.system = <function system at 0x?>
27535
0d0f4070f6d7 test-demandimport: ensure that relative imports are deferred
Bryan O'Sullivan <bos@serpentine.com>
parents: 21025
diff changeset
    14
hgweb = <unloaded module 'hgweb'>
0d0f4070f6d7 test-demandimport: ensure that relative imports are deferred
Bryan O'Sullivan <bos@serpentine.com>
parents: 21025
diff changeset
    15
hgweb_mod = <unloaded module 'hgweb_mod'>
0d0f4070f6d7 test-demandimport: ensure that relative imports are deferred
Bryan O'Sullivan <bos@serpentine.com>
parents: 21025
diff changeset
    16
hgweb = <module 'mercurial.hgweb' from '?'>
4631
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    17
fred = <unloaded module 're'>
32447
252d2260c74e demandimport: look for 'mod' suffix as alternative name for module reference
Yuya Nishihara <yuya@tcha.org>
parents: 30647
diff changeset
    18
remod = <unloaded module 're'>
4631
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    19
re = <unloaded module 'sys'>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    20
fred = <unloaded module 're'>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    21
fred.sub = <function sub at 0x?>
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    22
fred = <proxied module 're'>
32447
252d2260c74e demandimport: look for 'mod' suffix as alternative name for module reference
Yuya Nishihara <yuya@tcha.org>
parents: 30647
diff changeset
    23
remod = <module 're' from '?'>
4631
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    24
re = <unloaded module 'sys'>
13083
c0290fc6b486 test-demandimport.py: PyPy support
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 9174
diff changeset
    25
re.stderr = <open file '<whatever>', mode 'w' at 0x?>
4631
e3afa670e484 demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    26
re = <proxied module 'sys'>
30022
26a4e46af2bc demandimport: error out early on missing attribute of non package (issue5373)
Yuya Nishihara <yuya@tcha.org>
parents: 27535
diff changeset
    27
contextlib = <unloaded module 'contextlib'>
26a4e46af2bc demandimport: error out early on missing attribute of non package (issue5373)
Yuya Nishihara <yuya@tcha.org>
parents: 27535
diff changeset
    28
contextlib.unknownattr = ImportError: cannot import name unknownattr
30647
1914db1b7d9e demandimport: do not raise ImportError for unknown item in fromlist
Yuya Nishihara <yuya@tcha.org>
parents: 30022
diff changeset
    29
__import__('contextlib', ..., ['unknownattr']) = <module 'contextlib' from '?'>
1914db1b7d9e demandimport: do not raise ImportError for unknown item in fromlist
Yuya Nishihara <yuya@tcha.org>
parents: 30022
diff changeset
    30
hasattr(contextlibimp, 'unknownattr') = False