Mercurial > hg
annotate tests/test-lrucachedict.py.out @ 29196:bf7b8157c483 stable
strip: invalidate phase cache after stripping changeset (issue5235)
When we remove a changeset from the changelog, the phase cache must be
invalidated, otherwise it could refer to changesets that are no longer in the
repo.
To reproduce the failure, I created an extension querying the phase cache after
the strip transaction is over.
To do that, I stripped two commits with a bookmark on one of them to force
another transaction (we open a transaction for moving bookmarks)
after the strip transaction.
Without the fix in this patch, the test leads to a stacktrace showing the issue:
repair.strip(ui, repo, revs, backup)
File "/Users/lcharignon/facebook-hg-rpms/hg-crew/mercurial/repair.py", line 205, in strip
tr.close()
File "/Users/lcharignon/facebook-hg-rpms/hg-crew/mercurial/transaction.py", line 44, in _active
return func(self, *args, **kwds)
File "/Users/lcharignon/facebook-hg-rpms/hg-crew/mercurial/transaction.py", line 490, in close
self._postclosecallback[cat](self)
File "$TESTTMP/crashstrip2.py", line 4, in test
[repo.changelog.node(r) for r in repo.revs("not public()")]
File "/Users/lcharignon/facebook-hg-rpms/hg-crew/mercurial/changelog.py", line 337, in node
return super(changelog, self).node(rev)
File "/Users/lcharignon/facebook-hg-rpms/hg-crew/mercurial/revlog.py", line 377, in node
return self.index[rev][7]
IndexError: revlog index out of range
The situation was encountered in inhibit (evolve's repo) where we would crash
following the volatile set invalidation submitted by Augie in
e6f490e328635312ee214a12bc7fd3c7d46bf9ce. Before his patch the issue was masked
as we were not accessing the phasecache after stripping a revision.
This bug uncovered another but in histedit (see explanation in issue5235).
I changed the histedit test accordingly to avoid fixing two things at once.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Thu, 12 May 2016 06:13:59 -0700 |
parents | 6cd3044985c2 |
children |
rev | line source |
---|---|
18603 | 1 'a' in d: True |
2 d['a']: va | |
3 'b' in d: True | |
4 d['b']: vb | |
5 'c' in d: True | |
6 d['c']: vc | |
7 'd' in d: True | |
8 d['d']: vd | |
9 'a' in d: False | |
10 'b' in d: True | |
11 d['b']: vb | |
12 'c' in d: True | |
13 d['c']: vc | |
14 'd' in d: True | |
15 d['d']: vd | |
16 'e' in d: True | |
17 d['e']: ve | |
18 'b' in d: True | |
19 d['b']: vb2 | |
20 'c' in d: True | |
21 d['c']: vc2 | |
22 'd' in d: True | |
23 d['d']: vd | |
24 'e' in d: False | |
25 'f' in d: True | |
26 d['f']: vf | |
19710
887ffa22fd0d
lrucachedict: implement clear()
Siddharth Agarwal <sid0@fb.com>
parents:
18603
diff
changeset
|
27 'b' in d: False |
887ffa22fd0d
lrucachedict: implement clear()
Siddharth Agarwal <sid0@fb.com>
parents:
18603
diff
changeset
|
28 'c' in d: False |
887ffa22fd0d
lrucachedict: implement clear()
Siddharth Agarwal <sid0@fb.com>
parents:
18603
diff
changeset
|
29 'd' in d: False |
887ffa22fd0d
lrucachedict: implement clear()
Siddharth Agarwal <sid0@fb.com>
parents:
18603
diff
changeset
|
30 'e' in d: False |
887ffa22fd0d
lrucachedict: implement clear()
Siddharth Agarwal <sid0@fb.com>
parents:
18603
diff
changeset
|
31 'f' in d: False |
27371
45d996a566d7
util: reimplement lrucachedict
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19710
diff
changeset
|
32 'a' in d: True |
45d996a566d7
util: reimplement lrucachedict
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19710
diff
changeset
|
33 d['a']: 1 |
45d996a566d7
util: reimplement lrucachedict
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19710
diff
changeset
|
34 'b' in d: True |
45d996a566d7
util: reimplement lrucachedict
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19710
diff
changeset
|
35 d['b']: 2 |
27576
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
36 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
37 All of these should be present: |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
38 'a' in dc: True |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
39 dc['a']: va3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
40 'b' in dc: True |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
41 dc['b']: vb3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
42 'c' in dc: True |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
43 dc['c']: vc3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
44 'd' in dc: True |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
45 dc['d']: vd3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
46 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
47 All of these except 'a' should be present: |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
48 'a' in dc: False |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
49 'b' in dc: True |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
50 dc['b']: vb3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
51 'c' in dc: True |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
52 dc['c']: vc3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
53 'd' in dc: True |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
54 dc['d']: vd3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
55 'e' in dc: True |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
56 dc['e']: ve3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
57 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
58 These should be in reverse alphabetical order and read 'v?3': |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
59 d['d']: vd3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
60 d['c']: vc3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
61 d['b']: vb3 |
6cd3044985c2
lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents:
27371
diff
changeset
|
62 d['a']: va3 |