Mercurial > hg
annotate tests/test-bad-pull.t @ 21823:925d1bb9a971 stable
repoview: do not crash when localtags refers to non existing revisions
This fixes a crash that may happen when using mercurial 3.0.x.
The _gethiddenblockers function assumed that the output of tags.readlocaltags()
was a dict mapping tags to of valid nodes. However this was not necessarily the
case. When a repository had obsolete revisions and had local tag pointing to a
non existing revision was found, many mercurial commands would crash.
This revision fixes the problem by removing any tags from the output of
tags.readlocaltags() which point to invalid nodes.
We may want to add a warning when this happens (although it might be
annoying to get that warning for every command, possibly even more than once per
command).
A test for this problem has been added to test-obsolete.t. Without this fix the
test would output:
$ hg tags
abort: 00changelog.i@3816541e5485: no node!
[255]
Instead of:
$ hg tags
tiptag 2:3816541e5485
tip 2:3816541e5485
visible 0:193e9254ce7e
author | Angel Ezquerra <angel.ezquerra@gmail.com> |
---|---|
date | Sun, 29 Jun 2014 13:52:35 +0200 |
parents | 5d0538599428 |
children | 7a9cbb315d84 |
rev | line source |
---|---|
15446
c5c9ca3719f9
tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents:
12376
diff
changeset
|
1 $ "$TESTDIR/hghave" serve || exit 80 |
c5c9ca3719f9
tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents:
12376
diff
changeset
|
2 |
17019
5d0538599428
test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
16496
diff
changeset
|
3 #if windows |
5d0538599428
test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
16496
diff
changeset
|
4 $ hg clone http://localhost:$HGPORT/ copy |
5d0538599428
test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
16496
diff
changeset
|
5 abort: * (glob) |
5d0538599428
test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
16496
diff
changeset
|
6 [255] |
5d0538599428
test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
16496
diff
changeset
|
7 #else |
11859
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
8 $ hg clone http://localhost:$HGPORT/ copy |
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
9 abort: error: Connection refused |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11859
diff
changeset
|
10 [255] |
17019
5d0538599428
test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
16496
diff
changeset
|
11 #endif |
395 | 12 |
15515
21766d5531cb
tests: remove hacks for testing if file or directory exists
Mads Kiilerich <mads@kiilerich.com>
parents:
15446
diff
changeset
|
13 $ test -d copy |
21766d5531cb
tests: remove hacks for testing if file or directory exists
Mads Kiilerich <mads@kiilerich.com>
parents:
15446
diff
changeset
|
14 [1] |
395 | 15 |
11859
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
16 $ cat > dumb.py <<EOF |
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
17 > import BaseHTTPServer, SimpleHTTPServer, os, signal |
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
18 > def run(server_class=BaseHTTPServer.HTTPServer, |
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
19 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): |
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
20 > server_address = ('localhost', int(os.environ['HGPORT'])) |
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
21 > httpd = server_class(server_address, handler_class) |
16334
b9bd95e61b49
tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents:
16296
diff
changeset
|
22 > open("listening", "w") |
16296
4343d5226149
tests: eliminate daemon race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents:
15515
diff
changeset
|
23 > httpd.handle_request() |
11859
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
24 > run() |
f48178034569
tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents:
10154
diff
changeset
|
25 > EOF |
395 | 26 |
16334
b9bd95e61b49
tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents:
16296
diff
changeset
|
27 $ python dumb.py 2> log & |
b9bd95e61b49
tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents:
16296
diff
changeset
|
28 $ P=$! |
16496
abbabbbe4ec2
tests: use 'do sleep 0' instead of 'do true', also on first line of command
Mads Kiilerich <mads@kiilerich.com>
parents:
16341
diff
changeset
|
29 $ while [ ! -f listening ]; do sleep 0; done |
16334
b9bd95e61b49
tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents:
16296
diff
changeset
|
30 $ hg clone http://localhost:$HGPORT/foo copy2 |
b9bd95e61b49
tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents:
16296
diff
changeset
|
31 abort: HTTP Error 404: * (glob) |
b9bd95e61b49
tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents:
16296
diff
changeset
|
32 [255] |
b9bd95e61b49
tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents:
16296
diff
changeset
|
33 $ wait $P |