Mercurial > hg
annotate tests/test-bad-pull.t @ 17474:f85816af6294
obsolete: add a high level function to create an obsolete marker
This function is designed to be used by all code that creates new
obsolete markers in the local repository.
It is not used by debugobsolete because debugobsolete allows the
use of an unknown hash as argument.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Fri, 24 Aug 2012 21:16:23 +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 |