Mercurial > hg
annotate tests/test-demandimport.py.out @ 34107:4f60720cf0df
blackbox: fix rotation with chg
The added test will show:
$ $PYTHON showsize.py .hg/blackbox*
.hg/blackbox.log: < 500
.hg/blackbox.log.1: < 500
.hg/blackbox.log.2: < 500
.hg/blackbox.log.3: < 500
.hg/blackbox.log.4: < 500
.hg/blackbox.log.5: >= 500
with previous code.
The issue is caused by blackbox caching file objects *by path*, and the
rotation size check could run on a wrong file object (i.e. it should check
"blackbox.log", but `filehandles["blackbox.log"]` contains a file object
that has been renamed to "blackbox.log.5").
This patch removes the "filehandlers" global cache added by 45313f5a3a8c to
solve the issue.
I think the original patch was trying to make different ui objects use a same
file object if their blackbox.log path is the same. In theory it could also
be problematic in the rotation case. Anyway, that should become unnecessary
after D650.
Differential Revision: https://phab.mercurial-scm.org/D648
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 06 Sep 2017 19:27:30 -0700 |
parents | 91a2ec8e7fa0 |
children | b39f0fdb0338 |
rev | line source |
---|---|
4631
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
1 os = <unloaded module 'os'> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
2 os.system = <built-in function system> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
3 os = <module 'os' from '?'> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
4 util = <unloaded module 'util'> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
5 util.system = <function system at 0x?> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
6 util = <module 'mercurial.util' from '?'> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
7 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
|
8 hgweb = <unloaded module 'hgweb'> |
0d0f4070f6d7
test-demandimport: ensure that relative imports are deferred
Bryan O'Sullivan <bos@serpentine.com>
parents:
21025
diff
changeset
|
9 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
|
10 hgweb = <module 'mercurial.hgweb' from '?'> |
4631
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
11 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
|
12 remod = <unloaded module 're'> |
4631
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
13 re = <unloaded module 'sys'> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
14 fred = <unloaded module 're'> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
15 fred.sub = <function sub at 0x?> |
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
16 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
|
17 remod = <module 're' from '?'> |
4631
e3afa670e484
demandimport: fix issue579 and add a test
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
18 re = <unloaded module 'sys'> |
13083
c0290fc6b486
test-demandimport.py: PyPy support
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
9174
diff
changeset
|
19 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
|
20 re = <proxied module 'sys'> |
32448
91a2ec8e7fa0
demandimport: stop overriding __getattribute__()
Yuya Nishihara <yuya@tcha.org>
parents:
32447
diff
changeset
|
21 pvecproxy = <unloaded module 'pvec'> |
91a2ec8e7fa0
demandimport: stop overriding __getattribute__()
Yuya Nishihara <yuya@tcha.org>
parents:
32447
diff
changeset
|
22 pvecproxy.__doc__ = 'A "pvec" is ...' |
91a2ec8e7fa0
demandimport: stop overriding __getattribute__()
Yuya Nishihara <yuya@tcha.org>
parents:
32447
diff
changeset
|
23 pvecproxy.__name__ = 'mercurial.pvec' |
91a2ec8e7fa0
demandimport: stop overriding __getattribute__()
Yuya Nishihara <yuya@tcha.org>
parents:
32447
diff
changeset
|
24 pvecproxy.__dict__['__name__'] = 'mercurial.pvec' |
91a2ec8e7fa0
demandimport: stop overriding __getattribute__()
Yuya Nishihara <yuya@tcha.org>
parents:
32447
diff
changeset
|
25 pvecproxy = <proxied module 'pvec'> |
30022
26a4e46af2bc
demandimport: error out early on missing attribute of non package (issue5373)
Yuya Nishihara <yuya@tcha.org>
parents:
27535
diff
changeset
|
26 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
|
27 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
|
28 __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
|
29 hasattr(contextlibimp, 'unknownattr') = False |
21025
54af51c18c4c
demandimport: make it possible to disable by setting HGDEMANDIMPORT=disable
Mads Kiilerich <madski@unity3d.com>
parents:
13083
diff
changeset
|
30 node = <module 'mercurial.node' from '?'> |