Mercurial > hg
annotate tests/test-mq-subrepo-svn.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 | 048e41e9a6ac |
children | 6d88468d435b |
rev | line source |
---|---|
22046
7a9cbb315d84
tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents:
17033
diff
changeset
|
1 #require svn13 |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
2 |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22947
diff
changeset
|
3 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22947
diff
changeset
|
4 > [extensions] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22947
diff
changeset
|
5 > mq = |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22947
diff
changeset
|
6 > [diff] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22947
diff
changeset
|
7 > nodates = 1 |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22947
diff
changeset
|
8 > EOF |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
9 |
13326
535a891284da
test-subrepo-mq-svn.t: correct comment
Kevin Bullock <kbullock@ringworld.org>
parents:
13300
diff
changeset
|
10 fn to create new repository, and cd into it |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
11 $ mkrepo() { |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
12 > hg init $1 |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
13 > cd $1 |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
14 > hg qinit |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
15 > } |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
16 |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
17 |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
18 handle svn subrepos safely |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
19 |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
20 $ svnadmin create svn-repo-2499 |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
21 |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
22 $ SVNREPOPATH=`pwd`/svn-repo-2499/project |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
23 #if windows |
22947
c63a09b6b337
tests: use $PYTHON instead of hardcoding python
Augie Fackler <raf@durin42.com>
parents:
22046
diff
changeset
|
24 $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
25 #else |
22947
c63a09b6b337
tests: use $PYTHON instead of hardcoding python
Augie Fackler <raf@durin42.com>
parents:
22046
diff
changeset
|
26 $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
27 #endif |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
28 |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
29 $ mkdir -p svn-project-2499/trunk |
26374
048e41e9a6ac
tests: suppress verbose output of svn transaction
Yuya Nishihara <yuya@tcha.org>
parents:
24471
diff
changeset
|
30 $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL" |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
31 |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
32 qnew on repo w/svn subrepo |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
33 $ mkrepo repo-2499-svn-subrepo |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
34 $ svn co "$SVNREPOURL"/trunk sub |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
35 Checked out revision 1. |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
36 $ echo 'sub = [svn]sub' >> .hgsub |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
37 $ hg add .hgsub |
13410
1f2b2c33d386
tests: fixes for svn 1.4.2
Matt Mackall <mpm@selenic.com>
parents:
13326
diff
changeset
|
38 $ hg status -S -X '**/format' |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
39 A .hgsub |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
40 $ hg qnew -m0 0.diff |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
41 $ cd sub |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
42 $ echo a > a |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
43 $ svn add a |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
44 A a |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
45 $ svn st |
13410
1f2b2c33d386
tests: fixes for svn 1.4.2
Matt Mackall <mpm@selenic.com>
parents:
13326
diff
changeset
|
46 A* a (glob) |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
47 $ cd .. |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
48 $ hg status -S # doesn't show status for svn subrepos (yet) |
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
49 $ hg qnew -m1 1.diff |
24471
1ff35d76421c
subrepo: add bailifchanged to centralize raising Abort if subrepo is dirty
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
50 abort: uncommitted changes in subrepository 'sub' |
13300
23bbb5b888ea
subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff
changeset
|
51 [255] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16894
diff
changeset
|
52 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16894
diff
changeset
|
53 $ cd .. |