Mercurial > hg
annotate tests/test-push-r.t @ 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 | f2719b387380 |
children | 24ea47037186 |
rev | line source |
---|---|
12279 | 1 $ hg init test |
2 $ cd test | |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14117
diff
changeset
|
3 $ hg unbundle "$TESTDIR/bundles/remote.hg" |
14117
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
4 adding changesets |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
5 adding manifests |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
6 adding file changes |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
7 added 9 changesets with 7 changes to 4 files (+1 heads) |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
8 (run 'hg heads' to see heads, 'hg merge' to merge) |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
9 $ hg up tip |
12279 | 10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
11 $ cd .. | |
1781
284fc722c342
add an optional argument to push only the specified revisions (push -r)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
12 |
12279 | 13 $ for i in 0 1 2 3 4 5 6 7 8; do |
14 > echo | |
15 > mkdir test-"$i" | |
16 > hg --cwd test-"$i" init | |
17 > hg -R test push -r "$i" test-"$i" | |
18 > cd test-"$i" | |
19 > hg verify | |
20 > cd .. | |
21 > done | |
22 | |
23 pushing to test-0 | |
24 searching for changes | |
25 adding changesets | |
26 adding manifests | |
27 adding file changes | |
28 added 1 changesets with 1 changes to 1 files | |
29 checking changesets | |
30 checking manifests | |
31 crosschecking files in changesets and manifests | |
32 checking files | |
33 1 files, 1 changesets, 1 total revisions | |
34 | |
35 pushing to test-1 | |
36 searching for changes | |
37 adding changesets | |
38 adding manifests | |
39 adding file changes | |
40 added 2 changesets with 2 changes to 1 files | |
41 checking changesets | |
42 checking manifests | |
43 crosschecking files in changesets and manifests | |
44 checking files | |
45 1 files, 2 changesets, 2 total revisions | |
46 | |
47 pushing to test-2 | |
48 searching for changes | |
49 adding changesets | |
50 adding manifests | |
51 adding file changes | |
52 added 3 changesets with 3 changes to 1 files | |
53 checking changesets | |
54 checking manifests | |
55 crosschecking files in changesets and manifests | |
56 checking files | |
57 1 files, 3 changesets, 3 total revisions | |
58 | |
59 pushing to test-3 | |
60 searching for changes | |
61 adding changesets | |
62 adding manifests | |
63 adding file changes | |
64 added 4 changesets with 4 changes to 1 files | |
65 checking changesets | |
66 checking manifests | |
67 crosschecking files in changesets and manifests | |
68 checking files | |
69 1 files, 4 changesets, 4 total revisions | |
70 | |
71 pushing to test-4 | |
72 searching for changes | |
73 adding changesets | |
74 adding manifests | |
75 adding file changes | |
76 added 2 changesets with 2 changes to 1 files | |
77 checking changesets | |
78 checking manifests | |
79 crosschecking files in changesets and manifests | |
80 checking files | |
81 1 files, 2 changesets, 2 total revisions | |
82 | |
83 pushing to test-5 | |
84 searching for changes | |
85 adding changesets | |
86 adding manifests | |
87 adding file changes | |
88 added 3 changesets with 3 changes to 1 files | |
89 checking changesets | |
90 checking manifests | |
91 crosschecking files in changesets and manifests | |
92 checking files | |
93 1 files, 3 changesets, 3 total revisions | |
94 | |
95 pushing to test-6 | |
96 searching for changes | |
97 adding changesets | |
98 adding manifests | |
99 adding file changes | |
100 added 4 changesets with 5 changes to 2 files | |
101 checking changesets | |
102 checking manifests | |
103 crosschecking files in changesets and manifests | |
104 checking files | |
105 2 files, 4 changesets, 5 total revisions | |
106 | |
107 pushing to test-7 | |
108 searching for changes | |
109 adding changesets | |
110 adding manifests | |
111 adding file changes | |
112 added 5 changesets with 6 changes to 3 files | |
113 checking changesets | |
114 checking manifests | |
115 crosschecking files in changesets and manifests | |
116 checking files | |
117 3 files, 5 changesets, 6 total revisions | |
118 | |
119 pushing to test-8 | |
120 searching for changes | |
121 adding changesets | |
122 adding manifests | |
123 adding file changes | |
124 added 5 changesets with 5 changes to 2 files | |
125 checking changesets | |
126 checking manifests | |
127 crosschecking files in changesets and manifests | |
128 checking files | |
129 2 files, 5 changesets, 5 total revisions | |
130 | |
131 $ cd test-8 | |
132 | |
133 $ hg pull ../test-7 | |
134 pulling from ../test-7 | |
135 searching for changes | |
136 adding changesets | |
137 adding manifests | |
138 adding file changes | |
139 added 4 changesets with 2 changes to 3 files (+1 heads) | |
140 (run 'hg heads' to see heads, 'hg merge' to merge) | |
141 | |
142 $ hg verify | |
143 checking changesets | |
144 checking manifests | |
145 crosschecking files in changesets and manifests | |
146 checking files | |
147 4 files, 9 changesets, 7 total revisions | |
148 | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
149 $ cd .. |