Mercurial > hg
annotate tests/test-pull-permission.t @ 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 | 8fb6844a4ff1 |
children | eb586ed5d8ce |
rev | line source |
---|---|
22047
8fb6844a4ff1
tests: change some #ifs to #requires
Matt Mackall <mpm@selenic.com>
parents:
20008
diff
changeset
|
1 #require unix-permissions no-root |
15516
10f302f5e9f6
tests: add missing 'hghave unix-permissions'
Mads Kiilerich <mads@kiilerich.com>
parents:
13956
diff
changeset
|
2 |
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
12279
diff
changeset
|
3 $ hg init a |
12279 | 4 $ cd a |
5 $ echo foo > b | |
6 $ hg add b | |
7 $ hg ci -m "b" | |
1244
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
8 |
12279 | 9 $ chmod -w .hg/store |
10 | |
11 $ cd .. | |
1244
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
12 |
12279 | 13 $ hg clone a b |
14 requesting all changes | |
15 adding changesets | |
16 adding manifests | |
17 adding file changes | |
18 added 1 changesets with 1 changes to 1 files | |
19 updating to branch default | |
20 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1244
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
21 |
12279 | 22 $ chmod +w a/.hg/store # let test clean up |
1750
955a7caf005c
make test-pull-permission cleanup correctly in case of errors
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1244
diff
changeset
|
23 |
12279 | 24 $ cd b |
25 $ hg verify | |
26 checking changesets | |
27 checking manifests | |
28 crosschecking files in changesets and manifests | |
29 checking files | |
30 1 files, 1 changesets, 1 total revisions | |
1750
955a7caf005c
make test-pull-permission cleanup correctly in case of errors
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1244
diff
changeset
|
31 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15516
diff
changeset
|
32 $ cd .. |