Mercurial > hg
annotate tests/test-clone-update-order.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 | 701df761aa94 |
children | eb586ed5d8ce |
rev | line source |
---|---|
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
1 $ hg init |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
2 $ echo foo > bar |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
3 $ hg commit -Am default |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
4 adding bar |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
5 $ hg up -r null |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
6 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
7 $ hg branch mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
8 marked working directory as branch mine |
15615 | 9 (branches are permanent and global, did you want a bookmark?) |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
10 $ echo hello > world |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
11 $ hg commit -Am hello |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
12 adding world |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
13 $ hg up -r null |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
14 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
15 $ hg branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
16 marked working directory as branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
17 $ echo good > bye |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
18 $ hg commit -Am other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
19 adding bye |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
20 $ hg up -r mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
22 |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
23 $ hg clone -U -u . .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
24 abort: cannot specify both --noupdate and --updaterev |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12286
diff
changeset
|
25 [255] |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
26 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
27 $ hg clone -U .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
28 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
29 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
30 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
31 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
32 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
33 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
34 $ hg clone -u . .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
35 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
36 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
37 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
38 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
39 updating to branch mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
41 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
42 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
43 $ hg clone -u 0 .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
44 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
45 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
46 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
47 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
48 updating to branch default |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
50 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
51 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
52 $ hg clone -u 1 .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
53 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
54 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
55 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
56 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
57 updating to branch mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
59 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
60 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
61 $ hg clone -u 2 .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
62 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
63 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
64 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
65 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
66 updating to branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
67 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
68 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
69 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
70 Test -r mine ... mine is ignored: |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
71 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
72 $ hg clone -u 2 .#other ../b -r mine -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
73 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
74 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
75 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
76 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
77 updating to branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
78 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
79 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
80 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
81 $ hg clone .#other ../b -b default -b mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
82 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
83 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
84 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
85 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
86 updating to branch default |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
88 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
89 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
90 $ hg clone .#other ../b |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
91 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
92 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
93 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
94 added 1 changesets with 1 changes to 1 files |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
95 updating to branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
97 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
98 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
99 $ hg clone -U . ../c -r 1 -r 2 > /dev/null |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
100 $ hg clone ../c ../b |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
101 updating to branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
103 $ rm -rf ../b ../c |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
104 |