Show More
@@ -1,65 +1,79 b'' | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | # |
|
2 | # | |
3 | # simple script to be used in hooks |
|
3 | # simple script to be used in hooks | |
4 | # |
|
4 | # | |
5 | # put something like this in the repo .hg/hgrc: |
|
5 | # put something like this in the repo .hg/hgrc: | |
6 | # |
|
6 | # | |
7 | # [hooks] |
|
7 | # [hooks] | |
8 | # changegroup = python "$TESTDIR/printenv.py" <hookname> [exit] [output] |
|
8 | # changegroup = python "$TESTDIR/printenv.py" <hookname> [exit] [output] | |
9 | # |
|
9 | # | |
10 | # - <hookname> is a mandatory argument (e.g. "changegroup") |
|
10 | # - <hookname> is a mandatory argument (e.g. "changegroup") | |
11 | # - [exit] is the exit code of the hook (default: 0) |
|
11 | # - [exit] is the exit code of the hook (default: 0) | |
12 | # - [output] is the name of the output file (default: use sys.stdout) |
|
12 | # - [output] is the name of the output file (default: use sys.stdout) | |
13 | # the file will be opened in append mode. |
|
13 | # the file will be opened in append mode. | |
14 | # |
|
14 | # | |
15 | from __future__ import absolute_import |
|
15 | from __future__ import absolute_import | |
16 | import argparse |
|
16 | import argparse | |
17 | import os |
|
17 | import os | |
18 | import sys |
|
18 | import sys | |
19 |
|
19 | |||
20 | try: |
|
20 | try: | |
21 | import msvcrt |
|
21 | import msvcrt | |
22 | msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) |
|
22 | msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) | |
23 | msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
23 | msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
24 | msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) |
|
24 | msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) | |
25 | except ImportError: |
|
25 | except ImportError: | |
26 | pass |
|
26 | pass | |
27 |
|
27 | |||
28 | parser = argparse.ArgumentParser() |
|
28 | parser = argparse.ArgumentParser() | |
29 | parser.add_argument("name", help="the hook name, used for display") |
|
29 | parser.add_argument("name", help="the hook name, used for display") | |
30 | parser.add_argument( |
|
30 | parser.add_argument( | |
31 | "exitcode", |
|
31 | "exitcode", | |
32 | nargs="?", |
|
32 | nargs="?", | |
33 | default=0, |
|
33 | default=0, | |
34 | type=int, |
|
34 | type=int, | |
35 | help="the exit code for the hook", |
|
35 | help="the exit code for the hook", | |
36 | ) |
|
36 | ) | |
37 | parser.add_argument( |
|
37 | parser.add_argument( | |
38 | "out", nargs="?", default=None, help="where to write the output" |
|
38 | "out", nargs="?", default=None, help="where to write the output" | |
39 | ) |
|
39 | ) | |
|
40 | parser.add_argument( | |||
|
41 | "--line", | |||
|
42 | action="store_true", | |||
|
43 | help="print environment variables one per line instead of on a single line", | |||
|
44 | ) | |||
40 | args = parser.parse_args() |
|
45 | args = parser.parse_args() | |
41 |
|
46 | |||
42 | if args.out is None: |
|
47 | if args.out is None: | |
43 | out = sys.stdout |
|
48 | out = sys.stdout | |
44 | out = getattr(out, "buffer", out) |
|
49 | out = getattr(out, "buffer", out) | |
45 | else: |
|
50 | else: | |
46 | out = open(args.out, "ab") |
|
51 | out = open(args.out, "ab") | |
47 |
|
52 | |||
48 | # variables with empty values may not exist on all platforms, filter |
|
53 | # variables with empty values may not exist on all platforms, filter | |
49 | # them now for portability sake. |
|
54 | # them now for portability sake. | |
50 | env = [(k, v) for k, v in os.environ.items() |
|
55 | env = [(k, v) for k, v in os.environ.items() | |
51 | if k.startswith("HG_") and v] |
|
56 | if k.startswith("HG_") and v] | |
52 | env.sort() |
|
57 | env.sort() | |
53 |
|
58 | |||
54 | out.write(b"%s hook: " % args.name.encode('ascii')) |
|
59 | out.write(b"%s hook: " % args.name.encode('ascii')) | |
55 | if os.name == 'nt': |
|
60 | if os.name == 'nt': | |
56 | filter = lambda x: x.replace('\\', '/') |
|
61 | filter = lambda x: x.replace('\\', '/') | |
57 | else: |
|
62 | else: | |
58 | filter = lambda x: x |
|
63 | filter = lambda x: x | |
|
64 | ||||
59 | vars = [b"%s=%s" % (k.encode('ascii'), filter(v).encode('ascii')) |
|
65 | vars = [b"%s=%s" % (k.encode('ascii'), filter(v).encode('ascii')) | |
60 | for k, v in env] |
|
66 | for k, v in env] | |
61 | out.write(b" ".join(vars)) |
|
67 | ||
|
68 | # Print variables on out | |||
|
69 | if not args.line: | |||
|
70 | out.write(b" ".join(vars)) | |||
|
71 | else: | |||
|
72 | for var in vars: | |||
|
73 | out.write(var) | |||
|
74 | out.write(b"\n") | |||
|
75 | ||||
62 | out.write(b"\n") |
|
76 | out.write(b"\n") | |
63 | out.close() |
|
77 | out.close() | |
64 |
|
78 | |||
65 | sys.exit(args.exitcode) |
|
79 | sys.exit(args.exitcode) |
@@ -1,557 +1,564 b'' | |||||
1 | #require serve |
|
1 | #require serve | |
2 |
|
2 | |||
3 | $ hg init test |
|
3 | $ hg init test | |
4 | $ cd test |
|
4 | $ cd test | |
5 | $ echo foo>foo |
|
5 | $ echo foo>foo | |
6 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
6 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg | |
7 | $ echo foo>foo.d/foo |
|
7 | $ echo foo>foo.d/foo | |
8 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
8 | $ echo bar>foo.d/bAr.hg.d/BaR | |
9 | $ echo bar>foo.d/baR.d.hg/bAR |
|
9 | $ echo bar>foo.d/baR.d.hg/bAR | |
10 | $ hg commit -A -m 1 |
|
10 | $ hg commit -A -m 1 | |
11 | adding foo |
|
11 | adding foo | |
12 | adding foo.d/bAr.hg.d/BaR |
|
12 | adding foo.d/bAr.hg.d/BaR | |
13 | adding foo.d/baR.d.hg/bAR |
|
13 | adding foo.d/baR.d.hg/bAR | |
14 | adding foo.d/foo |
|
14 | adding foo.d/foo | |
15 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
15 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log | |
16 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
16 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid | |
17 |
|
17 | |||
18 | Test server address cannot be reused |
|
18 | Test server address cannot be reused | |
19 |
|
19 | |||
20 | $ hg serve -p $HGPORT1 2>&1 |
|
20 | $ hg serve -p $HGPORT1 2>&1 | |
21 | abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$ |
|
21 | abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$ | |
22 | [255] |
|
22 | [255] | |
23 |
|
23 | |||
24 | $ cd .. |
|
24 | $ cd .. | |
25 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
25 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS | |
26 |
|
26 | |||
27 | clone via stream |
|
27 | clone via stream | |
28 |
|
28 | |||
29 | #if no-reposimplestore |
|
29 | #if no-reposimplestore | |
30 | $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1 |
|
30 | $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1 | |
31 | streaming all changes |
|
31 | streaming all changes | |
32 | 9 files to transfer, 715 bytes of data |
|
32 | 9 files to transfer, 715 bytes of data | |
33 | transferred * bytes in * seconds (*/sec) (glob) |
|
33 | transferred * bytes in * seconds (*/sec) (glob) | |
34 | updating to branch default |
|
34 | updating to branch default | |
35 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
35 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
36 | $ hg verify -R copy |
|
36 | $ hg verify -R copy | |
37 | checking changesets |
|
37 | checking changesets | |
38 | checking manifests |
|
38 | checking manifests | |
39 | crosschecking files in changesets and manifests |
|
39 | crosschecking files in changesets and manifests | |
40 | checking files |
|
40 | checking files | |
41 | checked 1 changesets with 4 changes to 4 files |
|
41 | checked 1 changesets with 4 changes to 4 files | |
42 | #endif |
|
42 | #endif | |
43 |
|
43 | |||
44 | try to clone via stream, should use pull instead |
|
44 | try to clone via stream, should use pull instead | |
45 |
|
45 | |||
46 | $ hg clone --stream http://localhost:$HGPORT1/ copy2 |
|
46 | $ hg clone --stream http://localhost:$HGPORT1/ copy2 | |
47 | warning: stream clone requested but server has them disabled |
|
47 | warning: stream clone requested but server has them disabled | |
48 | requesting all changes |
|
48 | requesting all changes | |
49 | adding changesets |
|
49 | adding changesets | |
50 | adding manifests |
|
50 | adding manifests | |
51 | adding file changes |
|
51 | adding file changes | |
52 | added 1 changesets with 4 changes to 4 files |
|
52 | added 1 changesets with 4 changes to 4 files | |
53 | new changesets 8b6053c928fe |
|
53 | new changesets 8b6053c928fe | |
54 | updating to branch default |
|
54 | updating to branch default | |
55 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
55 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
56 |
|
56 | |||
57 | try to clone via stream but missing requirements, so should use pull instead |
|
57 | try to clone via stream but missing requirements, so should use pull instead | |
58 |
|
58 | |||
59 | $ cat > $TESTTMP/removesupportedformat.py << EOF |
|
59 | $ cat > $TESTTMP/removesupportedformat.py << EOF | |
60 | > from mercurial import localrepo |
|
60 | > from mercurial import localrepo | |
61 | > def extsetup(ui): |
|
61 | > def extsetup(ui): | |
62 | > localrepo.localrepository.supportedformats.remove(b'generaldelta') |
|
62 | > localrepo.localrepository.supportedformats.remove(b'generaldelta') | |
63 | > EOF |
|
63 | > EOF | |
64 |
|
64 | |||
65 | $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 |
|
65 | $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 | |
66 | warning: stream clone requested but client is missing requirements: generaldelta |
|
66 | warning: stream clone requested but client is missing requirements: generaldelta | |
67 | (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information) |
|
67 | (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information) | |
68 | requesting all changes |
|
68 | requesting all changes | |
69 | adding changesets |
|
69 | adding changesets | |
70 | adding manifests |
|
70 | adding manifests | |
71 | adding file changes |
|
71 | adding file changes | |
72 | added 1 changesets with 4 changes to 4 files |
|
72 | added 1 changesets with 4 changes to 4 files | |
73 | new changesets 8b6053c928fe |
|
73 | new changesets 8b6053c928fe | |
74 | updating to branch default |
|
74 | updating to branch default | |
75 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
75 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
76 |
|
76 | |||
77 | clone via pull |
|
77 | clone via pull | |
78 |
|
78 | |||
79 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
79 | $ hg clone http://localhost:$HGPORT1/ copy-pull | |
80 | requesting all changes |
|
80 | requesting all changes | |
81 | adding changesets |
|
81 | adding changesets | |
82 | adding manifests |
|
82 | adding manifests | |
83 | adding file changes |
|
83 | adding file changes | |
84 | added 1 changesets with 4 changes to 4 files |
|
84 | added 1 changesets with 4 changes to 4 files | |
85 | new changesets 8b6053c928fe |
|
85 | new changesets 8b6053c928fe | |
86 | updating to branch default |
|
86 | updating to branch default | |
87 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
87 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
88 | $ hg verify -R copy-pull |
|
88 | $ hg verify -R copy-pull | |
89 | checking changesets |
|
89 | checking changesets | |
90 | checking manifests |
|
90 | checking manifests | |
91 | crosschecking files in changesets and manifests |
|
91 | crosschecking files in changesets and manifests | |
92 | checking files |
|
92 | checking files | |
93 | checked 1 changesets with 4 changes to 4 files |
|
93 | checked 1 changesets with 4 changes to 4 files | |
94 | $ cd test |
|
94 | $ cd test | |
95 | $ echo bar > bar |
|
95 | $ echo bar > bar | |
96 | $ hg commit -A -d '1 0' -m 2 |
|
96 | $ hg commit -A -d '1 0' -m 2 | |
97 | adding bar |
|
97 | adding bar | |
98 | $ cd .. |
|
98 | $ cd .. | |
99 |
|
99 | |||
100 | clone over http with --update |
|
100 | clone over http with --update | |
101 |
|
101 | |||
102 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
102 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 | |
103 | requesting all changes |
|
103 | requesting all changes | |
104 | adding changesets |
|
104 | adding changesets | |
105 | adding manifests |
|
105 | adding manifests | |
106 | adding file changes |
|
106 | adding file changes | |
107 | added 2 changesets with 5 changes to 5 files |
|
107 | added 2 changesets with 5 changes to 5 files | |
108 | new changesets 8b6053c928fe:5fed3813f7f5 |
|
108 | new changesets 8b6053c928fe:5fed3813f7f5 | |
109 | updating to branch default |
|
109 | updating to branch default | |
110 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
111 | $ hg log -r . -R updated |
|
111 | $ hg log -r . -R updated | |
112 | changeset: 0:8b6053c928fe |
|
112 | changeset: 0:8b6053c928fe | |
113 | user: test |
|
113 | user: test | |
114 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
114 | date: Thu Jan 01 00:00:00 1970 +0000 | |
115 | summary: 1 |
|
115 | summary: 1 | |
116 |
|
116 | |||
117 | $ rm -rf updated |
|
117 | $ rm -rf updated | |
118 |
|
118 | |||
119 | incoming via HTTP |
|
119 | incoming via HTTP | |
120 |
|
120 | |||
121 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
121 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial | |
122 | adding changesets |
|
122 | adding changesets | |
123 | adding manifests |
|
123 | adding manifests | |
124 | adding file changes |
|
124 | adding file changes | |
125 | added 1 changesets with 4 changes to 4 files |
|
125 | added 1 changesets with 4 changes to 4 files | |
126 | new changesets 8b6053c928fe |
|
126 | new changesets 8b6053c928fe | |
127 | updating to branch default |
|
127 | updating to branch default | |
128 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
128 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
129 | $ cd partial |
|
129 | $ cd partial | |
130 | $ touch LOCAL |
|
130 | $ touch LOCAL | |
131 | $ hg ci -qAm LOCAL |
|
131 | $ hg ci -qAm LOCAL | |
132 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
132 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' | |
133 | comparing with http://localhost:$HGPORT1/ |
|
133 | comparing with http://localhost:$HGPORT1/ | |
134 | searching for changes |
|
134 | searching for changes | |
135 | 2 |
|
135 | 2 | |
136 | $ cd .. |
|
136 | $ cd .. | |
137 |
|
137 | |||
138 | pull |
|
138 | pull | |
139 |
|
139 | |||
140 | $ cd copy-pull |
|
140 | $ cd copy-pull | |
141 | $ cat >> .hg/hgrc <<EOF |
|
141 | $ cat >> .hg/hgrc <<EOF | |
142 | > [hooks] |
|
142 | > [hooks] | |
143 | > changegroup = sh -c "printenv.py changegroup" |
|
143 | > changegroup = sh -c "printenv.py --line changegroup" | |
144 | > EOF |
|
144 | > EOF | |
145 | $ hg pull |
|
145 | $ hg pull | |
146 | pulling from http://localhost:$HGPORT1/ |
|
146 | pulling from http://localhost:$HGPORT1/ | |
147 | searching for changes |
|
147 | searching for changes | |
148 | adding changesets |
|
148 | adding changesets | |
149 | adding manifests |
|
149 | adding manifests | |
150 | adding file changes |
|
150 | adding file changes | |
151 | added 1 changesets with 1 changes to 1 files |
|
151 | added 1 changesets with 1 changes to 1 files | |
152 | new changesets 5fed3813f7f5 |
|
152 | new changesets 5fed3813f7f5 | |
153 | changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ |
|
153 | changegroup hook: HG_HOOKNAME=changegroup | |
|
154 | HG_HOOKTYPE=changegroup | |||
|
155 | HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d | |||
|
156 | HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d | |||
|
157 | HG_SOURCE=pull | |||
|
158 | HG_TXNID=TXN:$ID$ | |||
|
159 | HG_URL=http://localhost:$HGPORT1/ | |||
|
160 | ||||
154 | (run 'hg update' to get a working copy) |
|
161 | (run 'hg update' to get a working copy) | |
155 | $ cd .. |
|
162 | $ cd .. | |
156 |
|
163 | |||
157 | clone from invalid URL |
|
164 | clone from invalid URL | |
158 |
|
165 | |||
159 | $ hg clone http://localhost:$HGPORT/bad |
|
166 | $ hg clone http://localhost:$HGPORT/bad | |
160 | abort: HTTP Error 404: Not Found |
|
167 | abort: HTTP Error 404: Not Found | |
161 | [255] |
|
168 | [255] | |
162 |
|
169 | |||
163 | test http authentication |
|
170 | test http authentication | |
164 | + use the same server to test server side streaming preference |
|
171 | + use the same server to test server side streaming preference | |
165 |
|
172 | |||
166 | $ cd test |
|
173 | $ cd test | |
167 | $ cat << EOT > userpass.py |
|
174 | $ cat << EOT > userpass.py | |
168 | > import base64 |
|
175 | > import base64 | |
169 | > from mercurial.hgweb import common |
|
176 | > from mercurial.hgweb import common | |
170 | > def perform_authentication(hgweb, req, op): |
|
177 | > def perform_authentication(hgweb, req, op): | |
171 | > auth = req.headers.get(b'Authorization') |
|
178 | > auth = req.headers.get(b'Authorization') | |
172 | > if not auth: |
|
179 | > if not auth: | |
173 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who', |
|
180 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who', | |
174 | > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')]) |
|
181 | > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')]) | |
175 | > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']: |
|
182 | > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']: | |
176 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') |
|
183 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') | |
177 | > def extsetup(): |
|
184 | > def extsetup(): | |
178 | > common.permhooks.insert(0, perform_authentication) |
|
185 | > common.permhooks.insert(0, perform_authentication) | |
179 | > EOT |
|
186 | > EOT | |
180 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
187 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ | |
181 | > --config server.preferuncompressed=True \ |
|
188 | > --config server.preferuncompressed=True \ | |
182 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
189 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log | |
183 | $ cat pid >> $DAEMON_PIDS |
|
190 | $ cat pid >> $DAEMON_PIDS | |
184 |
|
191 | |||
185 | $ cat << EOF > get_pass.py |
|
192 | $ cat << EOF > get_pass.py | |
186 | > import getpass |
|
193 | > import getpass | |
187 | > def newgetpass(arg): |
|
194 | > def newgetpass(arg): | |
188 | > return "pass" |
|
195 | > return "pass" | |
189 | > getpass.getpass = newgetpass |
|
196 | > getpass.getpass = newgetpass | |
190 | > EOF |
|
197 | > EOF | |
191 |
|
198 | |||
192 | $ hg id http://localhost:$HGPORT2/ |
|
199 | $ hg id http://localhost:$HGPORT2/ | |
193 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
200 | abort: http authorization required for http://localhost:$HGPORT2/ | |
194 | [255] |
|
201 | [255] | |
195 | $ hg id http://localhost:$HGPORT2/ |
|
202 | $ hg id http://localhost:$HGPORT2/ | |
196 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
203 | abort: http authorization required for http://localhost:$HGPORT2/ | |
197 | [255] |
|
204 | [255] | |
198 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
205 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ | |
199 | http authorization required for http://localhost:$HGPORT2/ |
|
206 | http authorization required for http://localhost:$HGPORT2/ | |
200 | realm: mercurial |
|
207 | realm: mercurial | |
201 | user: user |
|
208 | user: user | |
202 | password: 5fed3813f7f5 |
|
209 | password: 5fed3813f7f5 | |
203 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
210 | $ hg id http://user:pass@localhost:$HGPORT2/ | |
204 | 5fed3813f7f5 |
|
211 | 5fed3813f7f5 | |
205 | $ echo '[auth]' >> .hg/hgrc |
|
212 | $ echo '[auth]' >> .hg/hgrc | |
206 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
213 | $ echo 'l.schemes=http' >> .hg/hgrc | |
207 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
214 | $ echo 'l.prefix=lo' >> .hg/hgrc | |
208 | $ echo 'l.username=user' >> .hg/hgrc |
|
215 | $ echo 'l.username=user' >> .hg/hgrc | |
209 | $ echo 'l.password=pass' >> .hg/hgrc |
|
216 | $ echo 'l.password=pass' >> .hg/hgrc | |
210 | $ hg id http://localhost:$HGPORT2/ |
|
217 | $ hg id http://localhost:$HGPORT2/ | |
211 | 5fed3813f7f5 |
|
218 | 5fed3813f7f5 | |
212 | $ hg id http://localhost:$HGPORT2/ |
|
219 | $ hg id http://localhost:$HGPORT2/ | |
213 | 5fed3813f7f5 |
|
220 | 5fed3813f7f5 | |
214 | $ hg id http://user@localhost:$HGPORT2/ |
|
221 | $ hg id http://user@localhost:$HGPORT2/ | |
215 | 5fed3813f7f5 |
|
222 | 5fed3813f7f5 | |
216 |
|
223 | |||
217 | #if no-reposimplestore |
|
224 | #if no-reposimplestore | |
218 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
225 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 | |
219 | streaming all changes |
|
226 | streaming all changes | |
220 | 10 files to transfer, 1.01 KB of data |
|
227 | 10 files to transfer, 1.01 KB of data | |
221 | transferred * KB in * seconds (*/sec) (glob) |
|
228 | transferred * KB in * seconds (*/sec) (glob) | |
222 | updating to branch default |
|
229 | updating to branch default | |
223 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
230 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
224 | #endif |
|
231 | #endif | |
225 |
|
232 | |||
226 | --pull should override server's preferuncompressed |
|
233 | --pull should override server's preferuncompressed | |
227 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
234 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 | |
228 | requesting all changes |
|
235 | requesting all changes | |
229 | adding changesets |
|
236 | adding changesets | |
230 | adding manifests |
|
237 | adding manifests | |
231 | adding file changes |
|
238 | adding file changes | |
232 | added 2 changesets with 5 changes to 5 files |
|
239 | added 2 changesets with 5 changes to 5 files | |
233 | new changesets 8b6053c928fe:5fed3813f7f5 |
|
240 | new changesets 8b6053c928fe:5fed3813f7f5 | |
234 | updating to branch default |
|
241 | updating to branch default | |
235 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
242 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
236 |
|
243 | |||
237 | $ hg id http://user2@localhost:$HGPORT2/ |
|
244 | $ hg id http://user2@localhost:$HGPORT2/ | |
238 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
245 | abort: http authorization required for http://localhost:$HGPORT2/ | |
239 | [255] |
|
246 | [255] | |
240 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
247 | $ hg id http://user:pass2@localhost:$HGPORT2/ | |
241 | abort: HTTP Error 403: no |
|
248 | abort: HTTP Error 403: no | |
242 | [255] |
|
249 | [255] | |
243 |
|
250 | |||
244 | $ hg -R dest-pull tag -r tip top |
|
251 | $ hg -R dest-pull tag -r tip top | |
245 | $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ |
|
252 | $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ | |
246 | pushing to http://user:***@localhost:$HGPORT2/ |
|
253 | pushing to http://user:***@localhost:$HGPORT2/ | |
247 | searching for changes |
|
254 | searching for changes | |
248 | remote: adding changesets |
|
255 | remote: adding changesets | |
249 | remote: adding manifests |
|
256 | remote: adding manifests | |
250 | remote: adding file changes |
|
257 | remote: adding file changes | |
251 | remote: added 1 changesets with 1 changes to 1 files |
|
258 | remote: added 1 changesets with 1 changes to 1 files | |
252 | $ hg rollback -q |
|
259 | $ hg rollback -q | |
253 | $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes |
|
260 | $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes | |
254 | pushing to http://user:***@localhost:$HGPORT2/ |
|
261 | pushing to http://user:***@localhost:$HGPORT2/ | |
255 | using http://localhost:$HGPORT2/ |
|
262 | using http://localhost:$HGPORT2/ | |
256 | http auth: user user, password **** |
|
263 | http auth: user user, password **** | |
257 | sending capabilities command |
|
264 | sending capabilities command | |
258 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities |
|
265 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities | |
259 | http auth: user user, password **** |
|
266 | http auth: user user, password **** | |
260 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
267 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
261 | query 1; heads |
|
268 | query 1; heads | |
262 | devel-peer-request: batched-content |
|
269 | devel-peer-request: batched-content | |
263 | devel-peer-request: - heads (0 arguments) |
|
270 | devel-peer-request: - heads (0 arguments) | |
264 | devel-peer-request: - known (1 arguments) |
|
271 | devel-peer-request: - known (1 arguments) | |
265 | sending batch command |
|
272 | sending batch command | |
266 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch |
|
273 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch | |
267 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
274 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 | |
268 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
275 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
269 | devel-peer-request: 68 bytes of commands arguments in headers |
|
276 | devel-peer-request: 68 bytes of commands arguments in headers | |
270 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
277 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
271 | searching for changes |
|
278 | searching for changes | |
272 | all remote heads known locally |
|
279 | all remote heads known locally | |
273 | preparing listkeys for "phases" |
|
280 | preparing listkeys for "phases" | |
274 | sending listkeys command |
|
281 | sending listkeys command | |
275 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys |
|
282 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys | |
276 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
283 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 | |
277 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
284 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
278 | devel-peer-request: 16 bytes of commands arguments in headers |
|
285 | devel-peer-request: 16 bytes of commands arguments in headers | |
279 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
286 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
280 | received listkey for "phases": 58 bytes |
|
287 | received listkey for "phases": 58 bytes | |
281 | checking for updated bookmarks |
|
288 | checking for updated bookmarks | |
282 | preparing listkeys for "bookmarks" |
|
289 | preparing listkeys for "bookmarks" | |
283 | sending listkeys command |
|
290 | sending listkeys command | |
284 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys |
|
291 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys | |
285 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
292 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 | |
286 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
293 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
287 | devel-peer-request: 19 bytes of commands arguments in headers |
|
294 | devel-peer-request: 19 bytes of commands arguments in headers | |
288 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
295 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
289 | received listkey for "bookmarks": 0 bytes |
|
296 | received listkey for "bookmarks": 0 bytes | |
290 | sending branchmap command |
|
297 | sending branchmap command | |
291 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap |
|
298 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap | |
292 | devel-peer-request: Vary X-HgProto-1 |
|
299 | devel-peer-request: Vary X-HgProto-1 | |
293 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
300 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
294 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
301 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
295 | preparing listkeys for "bookmarks" |
|
302 | preparing listkeys for "bookmarks" | |
296 | sending listkeys command |
|
303 | sending listkeys command | |
297 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys |
|
304 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys | |
298 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
305 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 | |
299 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
306 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
300 | devel-peer-request: 19 bytes of commands arguments in headers |
|
307 | devel-peer-request: 19 bytes of commands arguments in headers | |
301 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
308 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
302 | received listkey for "bookmarks": 0 bytes |
|
309 | received listkey for "bookmarks": 0 bytes | |
303 | 1 changesets found |
|
310 | 1 changesets found | |
304 | list of changesets: |
|
311 | list of changesets: | |
305 | 7f4e523d01f2cc3765ac8934da3d14db775ff872 |
|
312 | 7f4e523d01f2cc3765ac8934da3d14db775ff872 | |
306 | bundle2-output-bundle: "HG20", 5 parts total |
|
313 | bundle2-output-bundle: "HG20", 5 parts total | |
307 | bundle2-output-part: "replycaps" 205 bytes payload |
|
314 | bundle2-output-part: "replycaps" 205 bytes payload | |
308 | bundle2-output-part: "check:phases" 24 bytes payload |
|
315 | bundle2-output-part: "check:phases" 24 bytes payload | |
309 | bundle2-output-part: "check:heads" streamed payload |
|
316 | bundle2-output-part: "check:heads" streamed payload | |
310 | bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload |
|
317 | bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload | |
311 | bundle2-output-part: "phase-heads" 24 bytes payload |
|
318 | bundle2-output-part: "phase-heads" 24 bytes payload | |
312 | sending unbundle command |
|
319 | sending unbundle command | |
313 | sending 1013 bytes |
|
320 | sending 1013 bytes | |
314 | devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle |
|
321 | devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle | |
315 | devel-peer-request: Content-length 1013 |
|
322 | devel-peer-request: Content-length 1013 | |
316 | devel-peer-request: Content-type application/mercurial-0.1 |
|
323 | devel-peer-request: Content-type application/mercurial-0.1 | |
317 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
324 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 | |
318 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
325 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
319 | devel-peer-request: 16 bytes of commands arguments in headers |
|
326 | devel-peer-request: 16 bytes of commands arguments in headers | |
320 | devel-peer-request: 1013 bytes of data |
|
327 | devel-peer-request: 1013 bytes of data | |
321 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
328 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
322 | bundle2-input-bundle: no-transaction |
|
329 | bundle2-input-bundle: no-transaction | |
323 | bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported |
|
330 | bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported | |
324 | bundle2-input-part: "output" (advisory) (params: 0 advisory) supported |
|
331 | bundle2-input-part: "output" (advisory) (params: 0 advisory) supported | |
325 | bundle2-input-part: total payload size 100 |
|
332 | bundle2-input-part: total payload size 100 | |
326 | remote: adding changesets |
|
333 | remote: adding changesets | |
327 | remote: adding manifests |
|
334 | remote: adding manifests | |
328 | remote: adding file changes |
|
335 | remote: adding file changes | |
329 | remote: added 1 changesets with 1 changes to 1 files |
|
336 | remote: added 1 changesets with 1 changes to 1 files | |
330 | bundle2-input-part: "output" (advisory) supported |
|
337 | bundle2-input-part: "output" (advisory) supported | |
331 | bundle2-input-bundle: 2 parts total |
|
338 | bundle2-input-bundle: 2 parts total | |
332 | preparing listkeys for "phases" |
|
339 | preparing listkeys for "phases" | |
333 | sending listkeys command |
|
340 | sending listkeys command | |
334 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys |
|
341 | devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys | |
335 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 |
|
342 | devel-peer-request: Vary X-HgArg-1,X-HgProto-1 | |
336 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
343 | devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
337 | devel-peer-request: 16 bytes of commands arguments in headers |
|
344 | devel-peer-request: 16 bytes of commands arguments in headers | |
338 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
345 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
339 | received listkey for "phases": 15 bytes |
|
346 | received listkey for "phases": 15 bytes | |
340 | $ hg rollback -q |
|
347 | $ hg rollback -q | |
341 |
|
348 | |||
342 | $ sed 's/.*] "/"/' < ../access.log |
|
349 | $ sed 's/.*] "/"/' < ../access.log | |
343 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
350 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
344 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
351 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
345 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
352 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
346 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
353 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
347 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
354 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
348 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
355 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
349 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
356 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
350 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
357 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
351 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
358 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
352 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
359 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
353 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
360 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
354 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
361 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
355 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
362 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
356 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
363 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
357 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
364 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
358 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
365 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
359 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
366 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
360 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
367 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
361 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
368 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
362 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
369 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
363 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
370 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
364 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
371 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
365 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
372 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
366 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
373 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
367 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
374 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
368 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
375 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
369 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
376 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
370 | "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) |
|
377 | "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) | |
371 | "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) |
|
378 | "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) | |
372 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
379 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) | |
373 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) |
|
380 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) | |
374 | "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) |
|
381 | "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) | |
375 | "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) |
|
382 | "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) | |
376 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
383 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
377 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
384 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
378 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
385 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
379 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
386 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
380 | "GET /?cmd=capabilities HTTP/1.1" 403 - |
|
387 | "GET /?cmd=capabilities HTTP/1.1" 403 - | |
381 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
388 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
382 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
389 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
383 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
390 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
384 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
391 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
385 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
392 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
386 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
393 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
387 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
394 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
388 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) |
|
395 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) | |
389 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
396 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
390 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
397 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
391 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
398 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
392 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
399 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
393 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
400 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
394 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
401 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
395 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
402 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
396 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
403 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
397 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
404 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
398 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
405 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
399 |
|
406 | |||
400 | $ cd .. |
|
407 | $ cd .. | |
401 |
|
408 | |||
402 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
409 | clone of serve with repo in root and unserved subrepo (issue2970) | |
403 |
|
410 | |||
404 | $ hg --cwd test init sub |
|
411 | $ hg --cwd test init sub | |
405 | $ echo empty > test/sub/empty |
|
412 | $ echo empty > test/sub/empty | |
406 | $ hg --cwd test/sub add empty |
|
413 | $ hg --cwd test/sub add empty | |
407 | $ hg --cwd test/sub commit -qm 'add empty' |
|
414 | $ hg --cwd test/sub commit -qm 'add empty' | |
408 | $ hg --cwd test/sub tag -r 0 something |
|
415 | $ hg --cwd test/sub tag -r 0 something | |
409 | $ echo sub = sub > test/.hgsub |
|
416 | $ echo sub = sub > test/.hgsub | |
410 | $ hg --cwd test add .hgsub |
|
417 | $ hg --cwd test add .hgsub | |
411 | $ hg --cwd test commit -qm 'add subrepo' |
|
418 | $ hg --cwd test commit -qm 'add subrepo' | |
412 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
419 | $ hg clone http://localhost:$HGPORT noslash-clone | |
413 | requesting all changes |
|
420 | requesting all changes | |
414 | adding changesets |
|
421 | adding changesets | |
415 | adding manifests |
|
422 | adding manifests | |
416 | adding file changes |
|
423 | adding file changes | |
417 | added 3 changesets with 7 changes to 7 files |
|
424 | added 3 changesets with 7 changes to 7 files | |
418 | new changesets 8b6053c928fe:56f9bc90cce6 |
|
425 | new changesets 8b6053c928fe:56f9bc90cce6 | |
419 | updating to branch default |
|
426 | updating to branch default | |
420 | cloning subrepo sub from http://localhost:$HGPORT/sub |
|
427 | cloning subrepo sub from http://localhost:$HGPORT/sub | |
421 | abort: HTTP Error 404: Not Found |
|
428 | abort: HTTP Error 404: Not Found | |
422 | [255] |
|
429 | [255] | |
423 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
430 | $ hg clone http://localhost:$HGPORT/ slash-clone | |
424 | requesting all changes |
|
431 | requesting all changes | |
425 | adding changesets |
|
432 | adding changesets | |
426 | adding manifests |
|
433 | adding manifests | |
427 | adding file changes |
|
434 | adding file changes | |
428 | added 3 changesets with 7 changes to 7 files |
|
435 | added 3 changesets with 7 changes to 7 files | |
429 | new changesets 8b6053c928fe:56f9bc90cce6 |
|
436 | new changesets 8b6053c928fe:56f9bc90cce6 | |
430 | updating to branch default |
|
437 | updating to branch default | |
431 | cloning subrepo sub from http://localhost:$HGPORT/sub |
|
438 | cloning subrepo sub from http://localhost:$HGPORT/sub | |
432 | abort: HTTP Error 404: Not Found |
|
439 | abort: HTTP Error 404: Not Found | |
433 | [255] |
|
440 | [255] | |
434 |
|
441 | |||
435 | check error log |
|
442 | check error log | |
436 |
|
443 | |||
437 | $ cat error.log |
|
444 | $ cat error.log | |
438 |
|
445 | |||
439 | check abort error reporting while pulling/cloning |
|
446 | check abort error reporting while pulling/cloning | |
440 |
|
447 | |||
441 | $ $RUNTESTDIR/killdaemons.py |
|
448 | $ $RUNTESTDIR/killdaemons.py | |
442 | $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py |
|
449 | $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py | |
443 | $ cat hg3.pid >> $DAEMON_PIDS |
|
450 | $ cat hg3.pid >> $DAEMON_PIDS | |
444 | $ hg clone http://localhost:$HGPORT/ abort-clone |
|
451 | $ hg clone http://localhost:$HGPORT/ abort-clone | |
445 | requesting all changes |
|
452 | requesting all changes | |
446 | remote: abort: this is an exercise |
|
453 | remote: abort: this is an exercise | |
447 | abort: pull failed on remote |
|
454 | abort: pull failed on remote | |
448 | [255] |
|
455 | [255] | |
449 | $ cat error.log |
|
456 | $ cat error.log | |
450 |
|
457 | |||
451 | disable pull-based clones |
|
458 | disable pull-based clones | |
452 |
|
459 | |||
453 | $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True |
|
460 | $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True | |
454 | $ cat hg4.pid >> $DAEMON_PIDS |
|
461 | $ cat hg4.pid >> $DAEMON_PIDS | |
455 | $ hg clone http://localhost:$HGPORT1/ disable-pull-clone |
|
462 | $ hg clone http://localhost:$HGPORT1/ disable-pull-clone | |
456 | requesting all changes |
|
463 | requesting all changes | |
457 | remote: abort: server has pull-based clones disabled |
|
464 | remote: abort: server has pull-based clones disabled | |
458 | abort: pull failed on remote |
|
465 | abort: pull failed on remote | |
459 | (remove --pull if specified or upgrade Mercurial) |
|
466 | (remove --pull if specified or upgrade Mercurial) | |
460 | [255] |
|
467 | [255] | |
461 |
|
468 | |||
462 | #if no-reposimplestore |
|
469 | #if no-reposimplestore | |
463 | ... but keep stream clones working |
|
470 | ... but keep stream clones working | |
464 |
|
471 | |||
465 | $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone |
|
472 | $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone | |
466 | streaming all changes |
|
473 | streaming all changes | |
467 | * files to transfer, * of data (glob) |
|
474 | * files to transfer, * of data (glob) | |
468 | transferred * in * seconds (*/sec) (glob) |
|
475 | transferred * in * seconds (*/sec) (glob) | |
469 | $ cat error.log |
|
476 | $ cat error.log | |
470 | #endif |
|
477 | #endif | |
471 |
|
478 | |||
472 | ... and also keep partial clones and pulls working |
|
479 | ... and also keep partial clones and pulls working | |
473 | $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone |
|
480 | $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone | |
474 | adding changesets |
|
481 | adding changesets | |
475 | adding manifests |
|
482 | adding manifests | |
476 | adding file changes |
|
483 | adding file changes | |
477 | added 1 changesets with 4 changes to 4 files |
|
484 | added 1 changesets with 4 changes to 4 files | |
478 | new changesets 8b6053c928fe |
|
485 | new changesets 8b6053c928fe | |
479 | updating to branch default |
|
486 | updating to branch default | |
480 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
487 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
481 | $ hg pull -R test/partial/clone |
|
488 | $ hg pull -R test/partial/clone | |
482 | pulling from http://localhost:$HGPORT1/ |
|
489 | pulling from http://localhost:$HGPORT1/ | |
483 | searching for changes |
|
490 | searching for changes | |
484 | adding changesets |
|
491 | adding changesets | |
485 | adding manifests |
|
492 | adding manifests | |
486 | adding file changes |
|
493 | adding file changes | |
487 | added 2 changesets with 3 changes to 3 files |
|
494 | added 2 changesets with 3 changes to 3 files | |
488 | new changesets 5fed3813f7f5:56f9bc90cce6 |
|
495 | new changesets 5fed3813f7f5:56f9bc90cce6 | |
489 | (run 'hg update' to get a working copy) |
|
496 | (run 'hg update' to get a working copy) | |
490 |
|
497 | |||
491 | $ hg clone -U -r 0 test/partial/clone test/another/clone |
|
498 | $ hg clone -U -r 0 test/partial/clone test/another/clone | |
492 | adding changesets |
|
499 | adding changesets | |
493 | adding manifests |
|
500 | adding manifests | |
494 | adding file changes |
|
501 | adding file changes | |
495 | added 1 changesets with 4 changes to 4 files |
|
502 | added 1 changesets with 4 changes to 4 files | |
496 | new changesets 8b6053c928fe |
|
503 | new changesets 8b6053c928fe | |
497 |
|
504 | |||
498 | corrupt cookies file should yield a warning |
|
505 | corrupt cookies file should yield a warning | |
499 |
|
506 | |||
500 | $ cat > $TESTTMP/cookies.txt << EOF |
|
507 | $ cat > $TESTTMP/cookies.txt << EOF | |
501 | > bad format |
|
508 | > bad format | |
502 | > EOF |
|
509 | > EOF | |
503 |
|
510 | |||
504 | $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/ |
|
511 | $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/ | |
505 | (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob) |
|
512 | (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob) | |
506 | 56f9bc90cce6 |
|
513 | 56f9bc90cce6 | |
507 |
|
514 | |||
508 | $ killdaemons.py |
|
515 | $ killdaemons.py | |
509 |
|
516 | |||
510 | Create dummy authentication handler that looks for cookies. It doesn't do anything |
|
517 | Create dummy authentication handler that looks for cookies. It doesn't do anything | |
511 | useful. It just raises an HTTP 500 with details about the Cookie request header. |
|
518 | useful. It just raises an HTTP 500 with details about the Cookie request header. | |
512 | We raise HTTP 500 because its message is printed in the abort message. |
|
519 | We raise HTTP 500 because its message is printed in the abort message. | |
513 |
|
520 | |||
514 | $ cat > cookieauth.py << EOF |
|
521 | $ cat > cookieauth.py << EOF | |
515 | > from mercurial import util |
|
522 | > from mercurial import util | |
516 | > from mercurial.hgweb import common |
|
523 | > from mercurial.hgweb import common | |
517 | > def perform_authentication(hgweb, req, op): |
|
524 | > def perform_authentication(hgweb, req, op): | |
518 | > cookie = req.headers.get(b'Cookie') |
|
525 | > cookie = req.headers.get(b'Cookie') | |
519 | > if not cookie: |
|
526 | > if not cookie: | |
520 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie') |
|
527 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie') | |
521 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie) |
|
528 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie) | |
522 | > def extsetup(): |
|
529 | > def extsetup(): | |
523 | > common.permhooks.insert(0, perform_authentication) |
|
530 | > common.permhooks.insert(0, perform_authentication) | |
524 | > EOF |
|
531 | > EOF | |
525 |
|
532 | |||
526 | $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid |
|
533 | $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid | |
527 | $ cat pid > $DAEMON_PIDS |
|
534 | $ cat pid > $DAEMON_PIDS | |
528 |
|
535 | |||
529 | Request without cookie sent should fail due to lack of cookie |
|
536 | Request without cookie sent should fail due to lack of cookie | |
530 |
|
537 | |||
531 | $ hg id http://localhost:$HGPORT |
|
538 | $ hg id http://localhost:$HGPORT | |
532 | abort: HTTP Error 500: no-cookie |
|
539 | abort: HTTP Error 500: no-cookie | |
533 | [255] |
|
540 | [255] | |
534 |
|
541 | |||
535 | Populate a cookies file |
|
542 | Populate a cookies file | |
536 |
|
543 | |||
537 | $ cat > cookies.txt << EOF |
|
544 | $ cat > cookies.txt << EOF | |
538 | > # HTTP Cookie File |
|
545 | > # HTTP Cookie File | |
539 | > # Expiration is 2030-01-01 at midnight |
|
546 | > # Expiration is 2030-01-01 at midnight | |
540 | > .example.com TRUE / FALSE 1893456000 hgkey examplevalue |
|
547 | > .example.com TRUE / FALSE 1893456000 hgkey examplevalue | |
541 | > EOF |
|
548 | > EOF | |
542 |
|
549 | |||
543 | Should not send a cookie for another domain |
|
550 | Should not send a cookie for another domain | |
544 |
|
551 | |||
545 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ |
|
552 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ | |
546 | abort: HTTP Error 500: no-cookie |
|
553 | abort: HTTP Error 500: no-cookie | |
547 | [255] |
|
554 | [255] | |
548 |
|
555 | |||
549 | Add a cookie entry for our test server and verify it is sent |
|
556 | Add a cookie entry for our test server and verify it is sent | |
550 |
|
557 | |||
551 | $ cat >> cookies.txt << EOF |
|
558 | $ cat >> cookies.txt << EOF | |
552 | > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue |
|
559 | > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue | |
553 | > EOF |
|
560 | > EOF | |
554 |
|
561 | |||
555 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ |
|
562 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ | |
556 | abort: HTTP Error 500: Cookie: hgkey=localhostvalue |
|
563 | abort: HTTP Error 500: Cookie: hgkey=localhostvalue | |
557 | [255] |
|
564 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now