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