##// END OF EJS Templates
test-static-http.t: get kill actually working...
Adrian Buehlmann -
r13208:b6693876 default
parent child Browse files
Show More
@@ -1,154 +1,154 b''
1 1
2 2 $ cp "$TESTDIR"/printenv.py .
3 3 $ hg clone http://localhost:$HGPORT/ copy
4 4 abort: error: Connection refused
5 5 [255]
6 6 $ test -d copy
7 7 [1]
8 8
9 9 This server doesn't do range requests so it's basically only good for
10 10 one pull
11 11
12 12 $ cat > dumb.py <<EOF
13 > import BaseHTTPServer, SimpleHTTPServer, os, signal
13 > import BaseHTTPServer, SimpleHTTPServer, os, signal, sys
14 14 >
15 15 > def run(server_class=BaseHTTPServer.HTTPServer,
16 16 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
17 17 > server_address = ('localhost', int(os.environ['HGPORT']))
18 18 > httpd = server_class(server_address, handler_class)
19 19 > httpd.serve_forever()
20 20 >
21 > signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
21 > signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0))
22 22 > run()
23 23 > EOF
24 24 $ python dumb.py 2>/dev/null &
25 25 $ echo $! >> $DAEMON_PIDS
26 26 $ mkdir remote
27 27 $ cd remote
28 28 $ hg init
29 29 $ echo foo > bar
30 30 $ hg add bar
31 31 $ hg commit -m"test"
32 32 $ hg tip
33 33 changeset: 0:61c9426e69fe
34 34 tag: tip
35 35 user: test
36 36 date: Thu Jan 01 00:00:00 1970 +0000
37 37 summary: test
38 38
39 39 $ cd ..
40 40 $ hg clone static-http://localhost:$HGPORT/remote local
41 41 requesting all changes
42 42 adding changesets
43 43 adding manifests
44 44 adding file changes
45 45 added 1 changesets with 1 changes to 1 files
46 46 updating to branch default
47 47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 48 $ cd local
49 49 $ hg verify
50 50 checking changesets
51 51 checking manifests
52 52 crosschecking files in changesets and manifests
53 53 checking files
54 54 1 files, 1 changesets, 1 total revisions
55 55 $ cat bar
56 56 foo
57 57 $ cd ../remote
58 58 $ echo baz > quux
59 59 $ hg commit -A -mtest2
60 60 adding quux
61 61
62 62 check for HTTP opener failures when cachefile does not exist
63 63
64 64 $ rm .hg/*.cache
65 65 $ cd ../local
66 66 $ echo '[hooks]' >> .hg/hgrc
67 67 $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
68 68 $ hg pull
69 69 changegroup hook: HG_NODE=822d6e31f08b9d6e3b898ce5e52efc0a4bf4905a HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
70 70 pulling from static-http://localhost:$HGPORT/remote
71 71 searching for changes
72 72 adding changesets
73 73 adding manifests
74 74 adding file changes
75 75 added 1 changesets with 1 changes to 1 files
76 76 (run 'hg update' to get a working copy)
77 77
78 78 trying to push
79 79
80 80 $ hg update
81 81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 82 $ echo more foo >> bar
83 83 $ hg commit -m"test"
84 84 $ hg push
85 85 pushing to static-http://localhost:$HGPORT/remote
86 86 abort: cannot lock static-http repository
87 87 [255]
88 88
89 89 trying clone -r
90 90
91 91 $ cd ..
92 92 $ hg clone -r donotexist static-http://localhost:$HGPORT/remote local0
93 93 abort: unknown revision 'donotexist'!
94 94 [255]
95 95 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
96 96 adding changesets
97 97 adding manifests
98 98 adding file changes
99 99 added 1 changesets with 1 changes to 1 files
100 100 updating to branch default
101 101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 102
103 103 test with "/" URI (issue 747)
104 104
105 105 $ hg init
106 106 $ echo a > a
107 107 $ hg add a
108 108 $ hg ci -ma
109 109 $ hg clone static-http://localhost:$HGPORT/ local2
110 110 requesting all changes
111 111 adding changesets
112 112 adding manifests
113 113 adding file changes
114 114 added 1 changesets with 1 changes to 1 files
115 115 updating to branch default
116 116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 117 $ cd local2
118 118 $ hg verify
119 119 checking changesets
120 120 checking manifests
121 121 crosschecking files in changesets and manifests
122 122 checking files
123 123 1 files, 1 changesets, 1 total revisions
124 124 $ cat a
125 125 a
126 126 $ hg paths
127 127 default = static-http://localhost:$HGPORT/
128 128
129 129 test with empty repo (issue965)
130 130
131 131 $ cd ..
132 132 $ hg init remotempty
133 133 $ hg clone static-http://localhost:$HGPORT/remotempty local3
134 134 no changes found
135 135 updating to branch default
136 136 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 137 $ cd local3
138 138 $ hg verify
139 139 checking changesets
140 140 checking manifests
141 141 crosschecking files in changesets and manifests
142 142 checking files
143 143 0 files, 0 changesets, 0 total revisions
144 144 $ hg paths
145 145 default = static-http://localhost:$HGPORT/remotempty
146 146
147 147 test with non-repo
148 148
149 149 $ cd ..
150 150 $ mkdir notarepo
151 151 $ hg clone static-http://localhost:$HGPORT/notarepo local3
152 152 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository!
153 153 [255]
154 154 $ kill $!
General Comments 0
You need to be logged in to leave comments. Login now