##// END OF EJS Templates
tests: unify test-http
Matt Mackall -
r12446:df57227a default
parent child Browse files
Show More
@@ -1,43 +1,88 b''
1 #!/bin/sh
2
1
3 cp "$TESTDIR"/printenv.py .
2 $ cp "$TESTDIR"/printenv.py .
3 $ hg init test
4 $ cd test
5 $ echo foo>foo
6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
7 $ echo foo>foo.d/foo
8 $ echo bar>foo.d/bAr.hg.d/BaR
9 $ echo bar>foo.d/baR.d.hg/bAR
10 $ hg commit -A -m 1
11 adding foo
12 adding foo.d/bAr.hg.d/BaR
13 adding foo.d/baR.d.hg/bAR
14 adding foo.d/foo
15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid
16 $ hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid
17
18 Test server address cannot be reused
4
19
5 hg init test
20 $ hg serve -p $HGPORT1 2>&1
6 cd test
21 abort: cannot start server at ':*': Address already in use (glob)
7 echo foo>foo
22 [255]
8 mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
23 $ cd ..
9 echo foo>foo.d/foo
24 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
10 echo bar>foo.d/bAr.hg.d/BaR
25
11 echo bar>foo.d/baR.d.hg/bAR
26 clone via stream
12
27
13 hg commit -A -m 1
28 $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1
14 hg serve -p $HGPORT -d --pid-file=../hg1.pid
29 streaming all changes
15 hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid
30 6 files to transfer, 606 bytes of data
16 # Test server address cannot be reused
31 transferred * bytes in * seconds (*B/sec) (glob)
17 hg serve -p $HGPORT1 2>&1 | sed -e "s/abort: cannot start server at ':$HGPORT1':.*/abort: cannot start server at ':\$HGPORT1':/"
32 updating to branch default
18 cd ..
33 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 cat hg1.pid hg2.pid >> $DAEMON_PIDS
34 $ hg verify -R copy
35 checking changesets
36 checking manifests
37 crosschecking files in changesets and manifests
38 checking files
39 4 files, 1 changesets, 4 total revisions
40
41 try to clone via stream, should use pull instead
20
42
21 echo % clone via stream
43 $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2
22 hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 | \
44 requesting all changes
23 sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/'
45 adding changesets
24 hg verify -R copy
46 adding manifests
47 adding file changes
48 added 1 changesets with 4 changes to 4 files
49 updating to branch default
50 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
25
51
26 echo % try to clone via stream, should use pull instead
52 clone via pull
27 hg clone --uncompressed http://localhost:$HGPORT1/ copy2
28
29 echo % clone via pull
30 hg clone http://localhost:$HGPORT1/ copy-pull
31 hg verify -R copy-pull
32
53
33 cd test
54 $ hg clone http://localhost:$HGPORT1/ copy-pull
34 echo bar > bar
55 requesting all changes
35 hg commit -A -d '1 0' -m 2
56 adding changesets
36 cd ..
57 adding manifests
58 adding file changes
59 added 1 changesets with 4 changes to 4 files
60 updating to branch default
61 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 $ hg verify -R copy-pull
63 checking changesets
64 checking manifests
65 crosschecking files in changesets and manifests
66 checking files
67 4 files, 1 changesets, 4 total revisions
68 $ cd test
69 $ echo bar > bar
70 $ hg commit -A -d '1 0' -m 2
71 adding bar
72 $ cd ..
37
73
38 echo % pull
74 pull
39 cd copy-pull
75
40 echo '[hooks]' >> .hg/hgrc
76 $ cd copy-pull
41 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
77 $ echo '[hooks]' >> .hg/hgrc
42 hg pull | sed -e "s,:$HGPORT1/,:\$HGPORT1/,"
78 $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
43 cd ..
79 $ hg pull
80 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:*/* (glob)
81 pulling from http://localhost:*/ (glob)
82 searching for changes
83 adding changesets
84 adding manifests
85 adding file changes
86 added 1 changesets with 1 changes to 1 files
87 (run 'hg update' to get a working copy)
88 $ cd ..
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now