Mercurial > hg
annotate tests/test-subrepo-paths.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 | ee07f9d142c9 |
children | 4441705b7111 |
rev | line source |
---|---|
11914
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
1 $ hg init outer |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
2 $ cd outer |
11775
a8614c5a5e9a
subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
3 |
15150
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
4 $ echo '[paths]' >> .hg/hgrc |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
5 $ echo 'default = http://example.net/' >> .hg/hgrc |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
6 |
11959
be33381882ad
test-subrepo-paths: moved comment lines to where they belong
Martin Geisler <mg@lazybytes.net>
parents:
11914
diff
changeset
|
7 hg debugsub with no remapping |
be33381882ad
test-subrepo-paths: moved comment lines to where they belong
Martin Geisler <mg@lazybytes.net>
parents:
11914
diff
changeset
|
8 |
15150
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
9 $ echo 'sub = libfoo' > .hgsub |
11914
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
10 $ hg add .hgsub |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
11 |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
12 $ hg debugsub |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
13 path sub |
15150
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
14 source libfoo |
11914
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
15 revision |
11775
a8614c5a5e9a
subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
16 |
11959
be33381882ad
test-subrepo-paths: moved comment lines to where they belong
Martin Geisler <mg@lazybytes.net>
parents:
11914
diff
changeset
|
17 hg debugsub with remapping |
be33381882ad
test-subrepo-paths: moved comment lines to where they belong
Martin Geisler <mg@lazybytes.net>
parents:
11914
diff
changeset
|
18 |
15150
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
19 $ echo '[subpaths]' >> .hg/hgrc |
19380
ee07f9d142c9
check-code: do not warn on printf \\x or \\[1-9]
Simon Heimberg <simohe@besonet.ch>
parents:
16913
diff
changeset
|
20 $ printf 'http://example.net/lib(.*) = C:\\libs\\\\1-lib\\\n' >> .hg/hgrc |
11775
a8614c5a5e9a
subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
21 |
11914
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
22 $ hg debugsub |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
23 path sub |
11961
f3075ffa6b30
subrepos: handle backslashes in subpaths
Martin Geisler <mg@lazybytes.net>
parents:
11959
diff
changeset
|
24 source C:\libs\foo-lib\ |
11914
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
25 revision |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
26 |
13582
4f5b269f4ce6
test-subrepo-paths: fix typo
Martin Geisler <mg@lazybytes.net>
parents:
13578
diff
changeset
|
27 test cumulative remapping, the $HGRCPATH file is loaded first |
13578
e720b3324e35
test-subrepo-paths: test cummulative remapping
Martin Geisler <mg@aragost.com>
parents:
12640
diff
changeset
|
28 |
e720b3324e35
test-subrepo-paths: test cummulative remapping
Martin Geisler <mg@aragost.com>
parents:
12640
diff
changeset
|
29 $ echo '[subpaths]' >> $HGRCPATH |
e720b3324e35
test-subrepo-paths: test cummulative remapping
Martin Geisler <mg@aragost.com>
parents:
12640
diff
changeset
|
30 $ echo 'libfoo = libbar' >> $HGRCPATH |
e720b3324e35
test-subrepo-paths: test cummulative remapping
Martin Geisler <mg@aragost.com>
parents:
12640
diff
changeset
|
31 $ hg debugsub |
e720b3324e35
test-subrepo-paths: test cummulative remapping
Martin Geisler <mg@aragost.com>
parents:
12640
diff
changeset
|
32 path sub |
e720b3324e35
test-subrepo-paths: test cummulative remapping
Martin Geisler <mg@aragost.com>
parents:
12640
diff
changeset
|
33 source C:\libs\bar-lib\ |
e720b3324e35
test-subrepo-paths: test cummulative remapping
Martin Geisler <mg@aragost.com>
parents:
12640
diff
changeset
|
34 revision |
e720b3324e35
test-subrepo-paths: test cummulative remapping
Martin Geisler <mg@aragost.com>
parents:
12640
diff
changeset
|
35 |
15150
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
36 test absolute source path -- testing with a URL is important since |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
37 standard os.path.join wont treat that as an absolute path |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
38 |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
39 $ echo 'abs = http://example.net/abs' > .hgsub |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
40 $ hg debugsub |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
41 path abs |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
42 source http://example.net/abs |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
43 revision |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
44 |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
45 $ echo 'abs = /abs' > .hgsub |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
46 $ hg debugsub |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
47 path abs |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
48 source /abs |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
49 revision |
91dc8878f888
subrepo: try remapping subpaths using the "final" path
Martin Geisler <mg@aragost.com>
parents:
13582
diff
changeset
|
50 |
11914
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
51 test bad subpaths pattern |
11775
a8614c5a5e9a
subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
52 |
11914
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
53 $ cat > .hg/hgrc <<EOF |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
54 > [subpaths] |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
55 > .* = \1 |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
56 > EOF |
e31e5eb8736c
tests: unify test-subrepo-paths
Martin Geisler <mg@lazybytes.net>
parents:
11775
diff
changeset
|
57 $ hg debugsub |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15150
diff
changeset
|
58 abort: bad subrepository pattern in $TESTTMP/outer/.hg/hgrc:2: invalid group reference (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11964
diff
changeset
|
59 [255] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16098
diff
changeset
|
60 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16098
diff
changeset
|
61 $ cd .. |