Show More
@@ -0,0 +1,67 b'' | |||||
|
1 | #require serve | |||
|
2 | ||||
|
3 | $ cat >> $HGRCPATH <<EOF | |||
|
4 | > [extensions] | |||
|
5 | > lfs= | |||
|
6 | > [lfs] | |||
|
7 | > url=http://localhost:$HGPORT/.git/info/lfs | |||
|
8 | > track=all() | |||
|
9 | > [web] | |||
|
10 | > push_ssl = False | |||
|
11 | > allow-push = * | |||
|
12 | > EOF | |||
|
13 | ||||
|
14 | Serving LFS files can experimentally be turned off. The long term solution is | |||
|
15 | to support the 'verify' action in both client and server, so that the server can | |||
|
16 | tell the client to store files elsewhere. | |||
|
17 | ||||
|
18 | $ hg init server | |||
|
19 | $ hg --config "lfs.usercache=$TESTTMP/servercache" \ | |||
|
20 | > --config experimental.lfs.serve=False -R server serve -d \ | |||
|
21 | > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log | |||
|
22 | $ cat hg.pid >> $DAEMON_PIDS | |||
|
23 | ||||
|
24 | Uploads fail... | |||
|
25 | ||||
|
26 | $ hg init client | |||
|
27 | $ echo 'this-is-an-lfs-file' > client/lfs.bin | |||
|
28 | $ hg -R client ci -Am 'initial commit' | |||
|
29 | adding lfs.bin | |||
|
30 | $ hg -R client push http://localhost:$HGPORT | |||
|
31 | pushing to http://localhost:$HGPORT/ | |||
|
32 | searching for changes | |||
|
33 | abort: LFS HTTP error: HTTP Error 400: no such method: .git (action=upload)! | |||
|
34 | [255] | |||
|
35 | ||||
|
36 | ... so do a local push to make the data available. Remove the blob from the | |||
|
37 | default cache, so it attempts to download. | |||
|
38 | $ hg --config "lfs.usercache=$TESTTMP/servercache" \ | |||
|
39 | > --config "lfs.url=null://" \ | |||
|
40 | > -R client push -q server | |||
|
41 | $ rm -rf `hg config lfs.usercache` | |||
|
42 | ||||
|
43 | Downloads fail... | |||
|
44 | ||||
|
45 | $ hg clone http://localhost:$HGPORT httpclone | |||
|
46 | requesting all changes | |||
|
47 | adding changesets | |||
|
48 | adding manifests | |||
|
49 | adding file changes | |||
|
50 | added 1 changesets with 1 changes to 1 files | |||
|
51 | new changesets 525251863cad | |||
|
52 | updating to branch default | |||
|
53 | abort: LFS HTTP error: HTTP Error 400: no such method: .git (action=download)! | |||
|
54 | [255] | |||
|
55 | ||||
|
56 | $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS | |||
|
57 | ||||
|
58 | $ cat $TESTTMP/access.log $TESTTMP/errors.log | |||
|
59 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |||
|
60 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D525251863cad618e55d483555f3d00a2ca99597e x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |||
|
61 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |||
|
62 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |||
|
63 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob) | |||
|
64 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |||
|
65 | $LOCALIP - - [$LOGDATE$] "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$ (glob) | |||
|
66 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |||
|
67 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob) |
@@ -166,6 +166,9 b" testedwith = 'ships-with-hg-core'" | |||||
166 | configtable = {} |
|
166 | configtable = {} | |
167 | configitem = registrar.configitem(configtable) |
|
167 | configitem = registrar.configitem(configtable) | |
168 |
|
168 | |||
|
169 | configitem('experimental', 'lfs.serve', | |||
|
170 | default=True, | |||
|
171 | ) | |||
169 | configitem('experimental', 'lfs.user-agent', |
|
172 | configitem('experimental', 'lfs.user-agent', | |
170 | default=None, |
|
173 | default=None, | |
171 | ) |
|
174 | ) |
@@ -31,6 +31,9 b' def handlewsgirequest(orig, rctx, req, r' | |||||
31 | if orig(rctx, req, res, checkperm): |
|
31 | if orig(rctx, req, res, checkperm): | |
32 | return True |
|
32 | return True | |
33 |
|
33 | |||
|
34 | if not rctx.repo.ui.configbool('experimental', 'lfs.serve'): | |||
|
35 | return False | |||
|
36 | ||||
34 | if not req.dispatchpath: |
|
37 | if not req.dispatchpath: | |
35 | return False |
|
38 | return False | |
36 |
|
39 |
General Comments 0
You need to be logged in to leave comments.
Login now