##// END OF EJS Templates
py3: add b'' and r'' prefixes to LFS tests
Matt Harbison -
r41468:2a1bb442 default
parent child Browse files
Show More
@@ -1,481 +1,481
1 #require serve no-reposimplestore no-chg
1 #require serve no-reposimplestore no-chg
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > lfs=
5 > lfs=
6 > [lfs]
6 > [lfs]
7 > track=all()
7 > track=all()
8 > [web]
8 > [web]
9 > push_ssl = False
9 > push_ssl = False
10 > allow-push = *
10 > allow-push = *
11 > EOF
11 > EOF
12
12
13 Serving LFS files can experimentally be turned off. The long term solution is
13 Serving LFS files can experimentally be turned off. The long term solution is
14 to support the 'verify' action in both client and server, so that the server can
14 to support the 'verify' action in both client and server, so that the server can
15 tell the client to store files elsewhere.
15 tell the client to store files elsewhere.
16
16
17 $ hg init server
17 $ hg init server
18 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
18 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
19 > --config experimental.lfs.serve=False -R server serve -d \
19 > --config experimental.lfs.serve=False -R server serve -d \
20 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
20 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
21 $ cat hg.pid >> $DAEMON_PIDS
21 $ cat hg.pid >> $DAEMON_PIDS
22
22
23 Uploads fail...
23 Uploads fail...
24
24
25 $ hg init client
25 $ hg init client
26 $ echo 'this-is-an-lfs-file' > client/lfs.bin
26 $ echo 'this-is-an-lfs-file' > client/lfs.bin
27 $ hg -R client ci -Am 'initial commit'
27 $ hg -R client ci -Am 'initial commit'
28 adding lfs.bin
28 adding lfs.bin
29 $ hg -R client push http://localhost:$HGPORT
29 $ hg -R client push http://localhost:$HGPORT
30 pushing to http://localhost:$HGPORT/
30 pushing to http://localhost:$HGPORT/
31 searching for changes
31 searching for changes
32 abort: LFS HTTP error: HTTP Error 400: no such method: .git!
32 abort: LFS HTTP error: HTTP Error 400: no such method: .git!
33 (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "upload" is supported)
33 (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "upload" is supported)
34 [255]
34 [255]
35
35
36 ... so do a local push to make the data available. Remove the blob from the
36 ... so do a local push to make the data available. Remove the blob from the
37 default cache, so it attempts to download.
37 default cache, so it attempts to download.
38 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
38 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
39 > --config "lfs.url=null://" \
39 > --config "lfs.url=null://" \
40 > -R client push -q server
40 > -R client push -q server
41 $ mv `hg config lfs.usercache` $TESTTMP/servercache
41 $ mv `hg config lfs.usercache` $TESTTMP/servercache
42
42
43 Downloads fail...
43 Downloads fail...
44
44
45 $ hg clone http://localhost:$HGPORT httpclone
45 $ hg clone http://localhost:$HGPORT httpclone
46 (remote is using large file support (lfs); lfs will be enabled for this repository)
46 (remote is using large file support (lfs); lfs will be enabled for this repository)
47 requesting all changes
47 requesting all changes
48 adding changesets
48 adding changesets
49 adding manifests
49 adding manifests
50 adding file changes
50 adding file changes
51 added 1 changesets with 1 changes to 1 files
51 added 1 changesets with 1 changes to 1 files
52 new changesets 525251863cad
52 new changesets 525251863cad
53 updating to branch default
53 updating to branch default
54 abort: LFS HTTP error: HTTP Error 400: no such method: .git!
54 abort: LFS HTTP error: HTTP Error 400: no such method: .git!
55 (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "download" is supported)
55 (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "download" is supported)
56 [255]
56 [255]
57
57
58 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
58 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
59
59
60 $ cat $TESTTMP/access.log $TESTTMP/errors.log
60 $ cat $TESTTMP/access.log $TESTTMP/errors.log
61 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
61 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
62 $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$ partial-pull (glob)
62 $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$ partial-pull (glob)
63 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
63 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
64 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
64 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
65 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob)
65 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob)
66 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
66 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
67 $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$ partial-pull (glob)
67 $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$ partial-pull (glob)
68 $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$ partial-pull (glob)
68 $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$ partial-pull (glob)
69 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob)
69 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob)
70
70
71 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
71 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
72 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server serve -d \
72 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server serve -d \
73 > -p $HGPORT --pid-file=hg.pid --prefix=subdir/mount/point \
73 > -p $HGPORT --pid-file=hg.pid --prefix=subdir/mount/point \
74 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
74 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
75 $ cat hg.pid >> $DAEMON_PIDS
75 $ cat hg.pid >> $DAEMON_PIDS
76
76
77 Reasonable hint for a misconfigured blob server
77 Reasonable hint for a misconfigured blob server
78
78
79 $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT/missing
79 $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT/missing
80 abort: LFS HTTP error: HTTP Error 404: Not Found!
80 abort: LFS HTTP error: HTTP Error 404: Not Found!
81 (the "lfs.url" config may be used to override http://localhost:$HGPORT/missing)
81 (the "lfs.url" config may be used to override http://localhost:$HGPORT/missing)
82 [255]
82 [255]
83
83
84 $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT2/missing
84 $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT2/missing
85 abort: LFS error: *onnection *refused*! (glob) (?)
85 abort: LFS error: *onnection *refused*! (glob) (?)
86 abort: LFS error: $EADDRNOTAVAIL$! (glob) (?)
86 abort: LFS error: $EADDRNOTAVAIL$! (glob) (?)
87 (the "lfs.url" config may be used to override http://localhost:$HGPORT2/missing)
87 (the "lfs.url" config may be used to override http://localhost:$HGPORT2/missing)
88 [255]
88 [255]
89
89
90 Blob URIs are correct when --prefix is used
90 Blob URIs are correct when --prefix is used
91
91
92 $ hg clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2
92 $ hg clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2
93 using http://localhost:$HGPORT/subdir/mount/point
93 using http://localhost:$HGPORT/subdir/mount/point
94 sending capabilities command
94 sending capabilities command
95 (remote is using large file support (lfs); lfs will be enabled for this repository)
95 (remote is using large file support (lfs); lfs will be enabled for this repository)
96 query 1; heads
96 query 1; heads
97 sending batch command
97 sending batch command
98 requesting all changes
98 requesting all changes
99 sending getbundle command
99 sending getbundle command
100 bundle2-input-bundle: with-transaction
100 bundle2-input-bundle: with-transaction
101 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
101 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
102 adding changesets
102 adding changesets
103 add changeset 525251863cad
103 add changeset 525251863cad
104 adding manifests
104 adding manifests
105 adding file changes
105 adding file changes
106 adding lfs.bin revisions
106 adding lfs.bin revisions
107 added 1 changesets with 1 changes to 1 files
107 added 1 changesets with 1 changes to 1 files
108 bundle2-input-part: total payload size 648
108 bundle2-input-part: total payload size 648
109 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
109 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
110 bundle2-input-part: "phase-heads" supported
110 bundle2-input-part: "phase-heads" supported
111 bundle2-input-part: total payload size 24
111 bundle2-input-part: total payload size 24
112 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
112 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
113 bundle2-input-part: total payload size 39
113 bundle2-input-part: total payload size 39
114 bundle2-input-bundle: 3 parts total
114 bundle2-input-bundle: 3 parts total
115 checking for updated bookmarks
115 checking for updated bookmarks
116 updating the branch cache
116 updating the branch cache
117 new changesets 525251863cad
117 new changesets 525251863cad
118 updating to branch default
118 updating to branch default
119 resolving manifests
119 resolving manifests
120 branchmerge: False, force: False, partial: False
120 branchmerge: False, force: False, partial: False
121 ancestor: 000000000000, local: 000000000000+, remote: 525251863cad
121 ancestor: 000000000000, local: 000000000000+, remote: 525251863cad
122 lfs: assuming remote store: http://localhost:$HGPORT/subdir/mount/point/.git/info/lfs
122 lfs: assuming remote store: http://localhost:$HGPORT/subdir/mount/point/.git/info/lfs
123 Status: 200
123 Status: 200
124 Content-Length: 371
124 Content-Length: 371
125 Content-Type: application/vnd.git-lfs+json
125 Content-Type: application/vnd.git-lfs+json
126 Date: $HTTP_DATE$
126 Date: $HTTP_DATE$
127 Server: testing stub value
127 Server: testing stub value
128 {
128 {
129 "objects": [
129 "objects": [
130 {
130 {
131 "actions": {
131 "actions": {
132 "download": {
132 "download": {
133 "expires_at": "$ISO_8601_DATE_TIME$"
133 "expires_at": "$ISO_8601_DATE_TIME$"
134 "header": {
134 "header": {
135 "Accept": "application/vnd.git-lfs"
135 "Accept": "application/vnd.git-lfs"
136 }
136 }
137 "href": "http://localhost:$HGPORT/subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
137 "href": "http://localhost:$HGPORT/subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
138 }
138 }
139 }
139 }
140 "oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
140 "oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
141 "size": 20
141 "size": 20
142 }
142 }
143 ]
143 ]
144 "transfer": "basic"
144 "transfer": "basic"
145 }
145 }
146 lfs: downloading f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e (20 bytes)
146 lfs: downloading f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e (20 bytes)
147 Status: 200
147 Status: 200
148 Content-Length: 20
148 Content-Length: 20
149 Content-Type: application/octet-stream
149 Content-Type: application/octet-stream
150 Date: $HTTP_DATE$
150 Date: $HTTP_DATE$
151 Server: testing stub value
151 Server: testing stub value
152 lfs: adding f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e to the usercache
152 lfs: adding f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e to the usercache
153 lfs: processed: f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
153 lfs: processed: f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
154 lfs: downloaded 1 files (20 bytes)
154 lfs: downloaded 1 files (20 bytes)
155 lfs.bin: remote created -> g
155 lfs.bin: remote created -> g
156 getting lfs.bin
156 getting lfs.bin
157 lfs: found f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e in the local lfs store
157 lfs: found f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e in the local lfs store
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
159 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
160
160
161 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
161 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
162
162
163 $ cat $TESTTMP/access.log $TESTTMP/errors.log
163 $ cat $TESTTMP/access.log $TESTTMP/errors.log
164 $LOCALIP - - [$LOGDATE$] "POST /missing/objects/batch HTTP/1.1" 404 - (glob)
164 $LOCALIP - - [$LOGDATE$] "POST /missing/objects/batch HTTP/1.1" 404 - (glob)
165 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=capabilities HTTP/1.1" 200 - (glob)
165 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=capabilities HTTP/1.1" 200 - (glob)
166 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?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 (glob)
166 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?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 (glob)
167 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?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$ partial-pull (glob)
167 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?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$ partial-pull (glob)
168 $LOCALIP - - [$LOGDATE$] "POST /subdir/mount/point/.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
168 $LOCALIP - - [$LOGDATE$] "POST /subdir/mount/point/.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
169 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e HTTP/1.1" 200 - (glob)
169 $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e HTTP/1.1" 200 - (glob)
170
170
171 Blobs that already exist in the usercache are linked into the repo store, even
171 Blobs that already exist in the usercache are linked into the repo store, even
172 though the client doesn't send the blob.
172 though the client doesn't send the blob.
173
173
174 $ hg init server2
174 $ hg init server2
175 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server2 serve -d \
175 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server2 serve -d \
176 > -p $HGPORT --pid-file=hg.pid \
176 > -p $HGPORT --pid-file=hg.pid \
177 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
177 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
178 $ cat hg.pid >> $DAEMON_PIDS
178 $ cat hg.pid >> $DAEMON_PIDS
179
179
180 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R cloned2 --debug \
180 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R cloned2 --debug \
181 > push http://localhost:$HGPORT | grep '^[{} ]'
181 > push http://localhost:$HGPORT | grep '^[{} ]'
182 {
182 {
183 "objects": [
183 "objects": [
184 {
184 {
185 "oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
185 "oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e"
186 "size": 20
186 "size": 20
187 }
187 }
188 ]
188 ]
189 "transfer": "basic"
189 "transfer": "basic"
190 }
190 }
191 $ find server2/.hg/store/lfs/objects | sort
191 $ find server2/.hg/store/lfs/objects | sort
192 server2/.hg/store/lfs/objects
192 server2/.hg/store/lfs/objects
193 server2/.hg/store/lfs/objects/f0
193 server2/.hg/store/lfs/objects/f0
194 server2/.hg/store/lfs/objects/f0/3217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
194 server2/.hg/store/lfs/objects/f0/3217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
195 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
195 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
196 $ cat $TESTTMP/errors.log
196 $ cat $TESTTMP/errors.log
197
197
198 $ cat >> $TESTTMP/lfsstoreerror.py <<EOF
198 $ cat >> $TESTTMP/lfsstoreerror.py <<EOF
199 > import errno
199 > import errno
200 > from hgext.lfs import blobstore
200 > from hgext.lfs import blobstore
201 >
201 >
202 > _numverifies = 0
202 > _numverifies = 0
203 > _readerr = True
203 > _readerr = True
204 >
204 >
205 > def reposetup(ui, repo):
205 > def reposetup(ui, repo):
206 > # Nothing to do with a remote repo
206 > # Nothing to do with a remote repo
207 > if not repo.local():
207 > if not repo.local():
208 > return
208 > return
209 >
209 >
210 > store = repo.svfs.lfslocalblobstore
210 > store = repo.svfs.lfslocalblobstore
211 > class badstore(store.__class__):
211 > class badstore(store.__class__):
212 > def download(self, oid, src):
212 > def download(self, oid, src):
213 > '''Called in the server to handle reading from the client in a
213 > '''Called in the server to handle reading from the client in a
214 > PUT request.'''
214 > PUT request.'''
215 > origread = src.read
215 > origread = src.read
216 > def _badread(nbytes):
216 > def _badread(nbytes):
217 > # Simulate bad data/checksum failure from the client
217 > # Simulate bad data/checksum failure from the client
218 > return b'0' * len(origread(nbytes))
218 > return b'0' * len(origread(nbytes))
219 > src.read = _badread
219 > src.read = _badread
220 > super(badstore, self).download(oid, src)
220 > super(badstore, self).download(oid, src)
221 >
221 >
222 > def _read(self, vfs, oid, verify):
222 > def _read(self, vfs, oid, verify):
223 > '''Called in the server to read data for a GET request, and then
223 > '''Called in the server to read data for a GET request, and then
224 > calls self._verify() on it before returning.'''
224 > calls self._verify() on it before returning.'''
225 > global _readerr
225 > global _readerr
226 > # One time simulation of a read error
226 > # One time simulation of a read error
227 > if _readerr:
227 > if _readerr:
228 > _readerr = False
228 > _readerr = False
229 > raise IOError(errno.EIO, '%s: I/O error' % oid)
229 > raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8"))
230 > # Simulate corrupt content on client download
230 > # Simulate corrupt content on client download
231 > blobstore._verify(oid, 'dummy content')
231 > blobstore._verify(oid, b'dummy content')
232 >
232 >
233 > def verify(self, oid):
233 > def verify(self, oid):
234 > '''Called in the server to populate the Batch API response,
234 > '''Called in the server to populate the Batch API response,
235 > letting the client re-upload if the file is corrupt.'''
235 > letting the client re-upload if the file is corrupt.'''
236 > # Fail verify in Batch API for one clone command and one push
236 > # Fail verify in Batch API for one clone command and one push
237 > # command with an IOError. Then let it through to access other
237 > # command with an IOError. Then let it through to access other
238 > # functions. Checksum failure is tested elsewhere.
238 > # functions. Checksum failure is tested elsewhere.
239 > global _numverifies
239 > global _numverifies
240 > _numverifies += 1
240 > _numverifies += 1
241 > if _numverifies <= 2:
241 > if _numverifies <= 2:
242 > raise IOError(errno.EIO, '%s: I/O error' % oid)
242 > raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8"))
243 > return super(badstore, self).verify(oid)
243 > return super(badstore, self).verify(oid)
244 >
244 >
245 > store.__class__ = badstore
245 > store.__class__ = badstore
246 > EOF
246 > EOF
247
247
248 $ rm -rf `hg config lfs.usercache`
248 $ rm -rf `hg config lfs.usercache`
249 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
249 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
250 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
250 $ hg --config "lfs.usercache=$TESTTMP/servercache" \
251 > --config extensions.lfsstoreerror=$TESTTMP/lfsstoreerror.py \
251 > --config extensions.lfsstoreerror=$TESTTMP/lfsstoreerror.py \
252 > -R server serve -d \
252 > -R server serve -d \
253 > -p $HGPORT1 --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
253 > -p $HGPORT1 --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
254 $ cat hg.pid >> $DAEMON_PIDS
254 $ cat hg.pid >> $DAEMON_PIDS
255
255
256 Test an I/O error in localstore.verify() (Batch API) with GET
256 Test an I/O error in localstore.verify() (Batch API) with GET
257
257
258 $ hg clone http://localhost:$HGPORT1 httpclone2
258 $ hg clone http://localhost:$HGPORT1 httpclone2
259 (remote is using large file support (lfs); lfs will be enabled for this repository)
259 (remote is using large file support (lfs); lfs will be enabled for this repository)
260 requesting all changes
260 requesting all changes
261 adding changesets
261 adding changesets
262 adding manifests
262 adding manifests
263 adding file changes
263 adding file changes
264 added 1 changesets with 1 changes to 1 files
264 added 1 changesets with 1 changes to 1 files
265 new changesets 525251863cad
265 new changesets 525251863cad
266 updating to branch default
266 updating to branch default
267 abort: LFS server error for "lfs.bin": Internal server error!
267 abort: LFS server error for "lfs.bin": Internal server error!
268 [255]
268 [255]
269
269
270 Test an I/O error in localstore.verify() (Batch API) with PUT
270 Test an I/O error in localstore.verify() (Batch API) with PUT
271
271
272 $ echo foo > client/lfs.bin
272 $ echo foo > client/lfs.bin
273 $ hg -R client ci -m 'mod lfs'
273 $ hg -R client ci -m 'mod lfs'
274 $ hg -R client push http://localhost:$HGPORT1
274 $ hg -R client push http://localhost:$HGPORT1
275 pushing to http://localhost:$HGPORT1/
275 pushing to http://localhost:$HGPORT1/
276 searching for changes
276 searching for changes
277 abort: LFS server error for "unknown": Internal server error!
277 abort: LFS server error for "unknown": Internal server error!
278 [255]
278 [255]
279 TODO: figure out how to associate the file name in the error above
279 TODO: figure out how to associate the file name in the error above
280
280
281 Test a bad checksum sent by the client in the transfer API
281 Test a bad checksum sent by the client in the transfer API
282
282
283 $ hg -R client push http://localhost:$HGPORT1
283 $ hg -R client push http://localhost:$HGPORT1
284 pushing to http://localhost:$HGPORT1/
284 pushing to http://localhost:$HGPORT1/
285 searching for changes
285 searching for changes
286 abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)!
286 abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)!
287 [255]
287 [255]
288
288
289 $ echo 'test lfs file' > server/lfs3.bin
289 $ echo 'test lfs file' > server/lfs3.bin
290 $ hg --config experimental.lfs.disableusercache=True \
290 $ hg --config experimental.lfs.disableusercache=True \
291 > -R server ci -Aqm 'another lfs file'
291 > -R server ci -Aqm 'another lfs file'
292 $ hg -R client pull -q http://localhost:$HGPORT1
292 $ hg -R client pull -q http://localhost:$HGPORT1
293
293
294 Test an I/O error during the processing of the GET request
294 Test an I/O error during the processing of the GET request
295
295
296 $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
296 $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
297 > -R client update -r tip
297 > -R client update -r tip
298 abort: LFS HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
298 abort: LFS HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
299 [255]
299 [255]
300
300
301 Test a checksum failure during the processing of the GET request
301 Test a checksum failure during the processing of the GET request
302
302
303 $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
303 $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
304 > -R client update -r tip
304 > -R client update -r tip
305 abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
305 abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
306 [255]
306 [255]
307
307
308 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
308 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
309
309
310 $ cat $TESTTMP/access.log
310 $ cat $TESTTMP/access.log
311 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
311 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
312 $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$ partial-pull (glob)
312 $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$ partial-pull (glob)
313 $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$ partial-pull (glob)
313 $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$ partial-pull (glob)
314 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
314 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
315 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
315 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
316 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
316 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
317 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
317 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
318 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
318 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
319 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
319 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
320 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
320 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
321 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
321 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
322 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
322 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
323 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
323 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
324 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
324 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
325 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
325 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
326 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
326 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
327 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
327 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
328 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
328 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
329 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c HTTP/1.1" 422 - (glob)
329 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c HTTP/1.1" 422 - (glob)
330 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
330 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
331 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
331 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
332 $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=525251863cad618e55d483555f3d00a2ca99597e&heads=506bf3d83f78c54b89e81c6411adee19fdf02156+525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
332 $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=525251863cad618e55d483555f3d00a2ca99597e&heads=506bf3d83f78c54b89e81c6411adee19fdf02156+525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
333 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
333 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
334 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 500 - (glob)
334 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 500 - (glob)
335 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
335 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
336 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 422 - (glob)
336 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 422 - (glob)
337
337
338 $ grep -v ' File "' $TESTTMP/errors.log
338 $ grep -v ' File "' $TESTTMP/errors.log
339 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.git/info/lfs/objects/batch': (glob)
339 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.git/info/lfs/objects/batch': (glob)
340 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
340 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
341 $LOCALIP - - [$ERRDATE$] HG error: verifies = store.verify(oid) (glob)
341 $LOCALIP - - [$ERRDATE$] HG error: verifies = store.verify(oid) (glob)
342 $LOCALIP - - [$ERRDATE$] HG error: raise IOError(errno.EIO, '%s: I/O error' % oid) (glob)
342 $LOCALIP - - [$ERRDATE$] HG error: raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8")) (glob)
343 $LOCALIP - - [$ERRDATE$] HG error: IOError: [Errno 5] f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error (glob)
343 $LOCALIP - - [$ERRDATE$] HG error: IOError: [Errno 5] f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error (glob)
344 $LOCALIP - - [$ERRDATE$] HG error: (glob)
344 $LOCALIP - - [$ERRDATE$] HG error: (glob)
345 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.git/info/lfs/objects/batch': (glob)
345 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.git/info/lfs/objects/batch': (glob)
346 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
346 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
347 $LOCALIP - - [$ERRDATE$] HG error: verifies = store.verify(oid) (glob)
347 $LOCALIP - - [$ERRDATE$] HG error: verifies = store.verify(oid) (glob)
348 $LOCALIP - - [$ERRDATE$] HG error: raise IOError(errno.EIO, '%s: I/O error' % oid) (glob)
348 $LOCALIP - - [$ERRDATE$] HG error: raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8")) (glob)
349 $LOCALIP - - [$ERRDATE$] HG error: IOError: [Errno 5] b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error (glob)
349 $LOCALIP - - [$ERRDATE$] HG error: IOError: [Errno 5] b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error (glob)
350 $LOCALIP - - [$ERRDATE$] HG error: (glob)
350 $LOCALIP - - [$ERRDATE$] HG error: (glob)
351 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c': (glob)
351 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c': (glob)
352 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
352 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
353 $LOCALIP - - [$ERRDATE$] HG error: localstore.download(oid, req.bodyfh) (glob)
353 $LOCALIP - - [$ERRDATE$] HG error: localstore.download(oid, req.bodyfh) (glob)
354 $LOCALIP - - [$ERRDATE$] HG error: super(badstore, self).download(oid, src) (glob)
354 $LOCALIP - - [$ERRDATE$] HG error: super(badstore, self).download(oid, src) (glob)
355 $LOCALIP - - [$ERRDATE$] HG error: % oid) (glob)
355 $LOCALIP - - [$ERRDATE$] HG error: % oid) (glob)
356 $LOCALIP - - [$ERRDATE$] HG error: LfsCorruptionError: corrupt remote lfs object: b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c (glob)
356 $LOCALIP - - [$ERRDATE$] HG error: LfsCorruptionError: corrupt remote lfs object: b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c (glob)
357 $LOCALIP - - [$ERRDATE$] HG error: (glob)
357 $LOCALIP - - [$ERRDATE$] HG error: (glob)
358 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob)
358 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob)
359 Traceback (most recent call last):
359 Traceback (most recent call last):
360 self.do_write()
360 self.do_write()
361 self.do_hgweb()
361 self.do_hgweb()
362 for chunk in self.server.application(env, self._start_response):
362 for chunk in self.server.application(env, self._start_response):
363 for r in self._runwsgi(req, res, repo):
363 for r in self._runwsgi(req, res, repo):
364 rctx, req, res, self.check_perm)
364 rctx, req, res, self.check_perm)
365 return func(*(args + a), **kw)
365 return func(*(args + a), **kw)
366 lambda perm:
366 lambda perm:
367 res.setbodybytes(localstore.read(oid))
367 res.setbodybytes(localstore.read(oid))
368 blob = self._read(self.vfs, oid, verify)
368 blob = self._read(self.vfs, oid, verify)
369 raise IOError(errno.EIO, '%s: I/O error' % oid)
369 raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8"))
370 IOError: [Errno 5] 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error
370 IOError: [Errno 5] 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error
371
371
372 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob)
372 $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob)
373 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
373 $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob)
374 $LOCALIP - - [$ERRDATE$] HG error: res.setbodybytes(localstore.read(oid)) (glob)
374 $LOCALIP - - [$ERRDATE$] HG error: res.setbodybytes(localstore.read(oid)) (glob)
375 $LOCALIP - - [$ERRDATE$] HG error: blob = self._read(self.vfs, oid, verify) (glob)
375 $LOCALIP - - [$ERRDATE$] HG error: blob = self._read(self.vfs, oid, verify) (glob)
376 $LOCALIP - - [$ERRDATE$] HG error: blobstore._verify(oid, 'dummy content') (glob)
376 $LOCALIP - - [$ERRDATE$] HG error: blobstore._verify(oid, b'dummy content') (glob)
377 $LOCALIP - - [$ERRDATE$] HG error: hint=_('run hg verify')) (glob)
377 $LOCALIP - - [$ERRDATE$] HG error: hint=_('run hg verify')) (glob)
378 $LOCALIP - - [$ERRDATE$] HG error: LfsCorruptionError: detected corrupt lfs object: 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d (glob)
378 $LOCALIP - - [$ERRDATE$] HG error: LfsCorruptionError: detected corrupt lfs object: 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d (glob)
379 $LOCALIP - - [$ERRDATE$] HG error: (glob)
379 $LOCALIP - - [$ERRDATE$] HG error: (glob)
380
380
381 Basic Authorization headers are returned by the Batch API, and sent back with
381 Basic Authorization headers are returned by the Batch API, and sent back with
382 the GET/PUT request.
382 the GET/PUT request.
383
383
384 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
384 $ rm -f $TESTTMP/access.log $TESTTMP/errors.log
385
385
386 $ cat >> $HGRCPATH << EOF
386 $ cat >> $HGRCPATH << EOF
387 > [experimental]
387 > [experimental]
388 > lfs.disableusercache = True
388 > lfs.disableusercache = True
389 > [auth]
389 > [auth]
390 > l.schemes=http
390 > l.schemes=http
391 > l.prefix=lo
391 > l.prefix=lo
392 > l.username=user
392 > l.username=user
393 > l.password=pass
393 > l.password=pass
394 > EOF
394 > EOF
395
395
396 $ cat << EOF > userpass.py
396 $ cat << EOF > userpass.py
397 > import base64
397 > import base64
398 > from mercurial.hgweb import common
398 > from mercurial.hgweb import common
399 > def perform_authentication(hgweb, req, op):
399 > def perform_authentication(hgweb, req, op):
400 > auth = req.headers.get(b'Authorization')
400 > auth = req.headers.get(b'Authorization')
401 > if not auth:
401 > if not auth:
402 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
402 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
403 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
403 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
404 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user',
404 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user',
405 > b'pass']:
405 > b'pass']:
406 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
406 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
407 > def extsetup(ui):
407 > def extsetup(ui):
408 > common.permhooks.insert(0, perform_authentication)
408 > common.permhooks.insert(0, perform_authentication)
409 > EOF
409 > EOF
410
410
411 $ hg --config extensions.x=$TESTTMP/userpass.py \
411 $ hg --config extensions.x=$TESTTMP/userpass.py \
412 > -R server serve -d -p $HGPORT1 --pid-file=hg.pid \
412 > -R server serve -d -p $HGPORT1 --pid-file=hg.pid \
413 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
413 > -A $TESTTMP/access.log -E $TESTTMP/errors.log
414 $ mv hg.pid $DAEMON_PIDS
414 $ mv hg.pid $DAEMON_PIDS
415
415
416 $ hg clone --debug http://localhost:$HGPORT1 auth_clone | egrep '^[{}]| '
416 $ hg clone --debug http://localhost:$HGPORT1 auth_clone | egrep '^[{}]| '
417 {
417 {
418 "objects": [
418 "objects": [
419 {
419 {
420 "actions": {
420 "actions": {
421 "download": {
421 "download": {
422 "expires_at": "$ISO_8601_DATE_TIME$"
422 "expires_at": "$ISO_8601_DATE_TIME$"
423 "header": {
423 "header": {
424 "Accept": "application/vnd.git-lfs"
424 "Accept": "application/vnd.git-lfs"
425 "Authorization": "Basic dXNlcjpwYXNz"
425 "Authorization": "Basic dXNlcjpwYXNz"
426 }
426 }
427 "href": "http://localhost:$HGPORT1/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d"
427 "href": "http://localhost:$HGPORT1/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d"
428 }
428 }
429 }
429 }
430 "oid": "276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d"
430 "oid": "276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d"
431 "size": 14
431 "size": 14
432 }
432 }
433 ]
433 ]
434 "transfer": "basic"
434 "transfer": "basic"
435 }
435 }
436
436
437 $ echo 'another blob' > auth_clone/lfs.blob
437 $ echo 'another blob' > auth_clone/lfs.blob
438 $ hg -R auth_clone ci -Aqm 'add blob'
438 $ hg -R auth_clone ci -Aqm 'add blob'
439 $ hg -R auth_clone --debug push | egrep '^[{}]| '
439 $ hg -R auth_clone --debug push | egrep '^[{}]| '
440 {
440 {
441 "objects": [
441 "objects": [
442 {
442 {
443 "actions": {
443 "actions": {
444 "upload": {
444 "upload": {
445 "expires_at": "$ISO_8601_DATE_TIME$"
445 "expires_at": "$ISO_8601_DATE_TIME$"
446 "header": {
446 "header": {
447 "Accept": "application/vnd.git-lfs"
447 "Accept": "application/vnd.git-lfs"
448 "Authorization": "Basic dXNlcjpwYXNz"
448 "Authorization": "Basic dXNlcjpwYXNz"
449 }
449 }
450 "href": "http://localhost:$HGPORT1/.hg/lfs/objects/df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3"
450 "href": "http://localhost:$HGPORT1/.hg/lfs/objects/df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3"
451 }
451 }
452 }
452 }
453 "oid": "df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3"
453 "oid": "df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3"
454 "size": 13
454 "size": 13
455 }
455 }
456 ]
456 ]
457 "transfer": "basic"
457 "transfer": "basic"
458 }
458 }
459
459
460 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
460 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
461
461
462 $ cat $TESTTMP/access.log $TESTTMP/errors.log
462 $ cat $TESTTMP/access.log $TESTTMP/errors.log
463 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 401 - (glob)
463 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 401 - (glob)
464 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
464 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
465 $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$ partial-pull (glob)
465 $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$ partial-pull (glob)
466 $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=506bf3d83f78c54b89e81c6411adee19fdf02156+525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
466 $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=506bf3d83f78c54b89e81c6411adee19fdf02156+525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
467 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 401 - (glob)
467 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 401 - (glob)
468 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
468 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
469 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 200 - (glob)
469 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 200 - (glob)
470 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 401 - (glob)
470 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 401 - (glob)
471 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
471 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
472 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D525251863cad618e55d483555f3d00a2ca99597e+4d9397055dc0c205f3132f331f36353ab1a525a3 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
472 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D525251863cad618e55d483555f3d00a2ca99597e+4d9397055dc0c205f3132f331f36353ab1a525a3 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
473 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
473 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
474 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
474 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
475 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
475 $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
476 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
476 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
477 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 401 - (glob)
477 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 401 - (glob)
478 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
478 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
479 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3 HTTP/1.1" 201 - (glob)
479 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3 HTTP/1.1" 201 - (glob)
480 $LOCALIP - - [$LOGDATE$] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
480 $LOCALIP - - [$LOGDATE$] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
481 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
481 $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
@@ -1,666 +1,666
1 #testcases lfsremote-on lfsremote-off
1 #testcases lfsremote-on lfsremote-off
2 #require serve no-reposimplestore no-chg
2 #require serve no-reposimplestore no-chg
3
3
4 This test splits `hg serve` with and without using the extension into separate
4 This test splits `hg serve` with and without using the extension into separate
5 tests cases. The tests are broken down as follows, where "LFS"/"No-LFS"
5 tests cases. The tests are broken down as follows, where "LFS"/"No-LFS"
6 indicates whether or not there are commits that use an LFS file, and "D"/"E"
6 indicates whether or not there are commits that use an LFS file, and "D"/"E"
7 indicates whether or not the extension is loaded. The "X" cases are not tested
7 indicates whether or not the extension is loaded. The "X" cases are not tested
8 individually, because the lfs requirement causes the process to bail early if
8 individually, because the lfs requirement causes the process to bail early if
9 the extension is disabled.
9 the extension is disabled.
10
10
11 . Server
11 . Server
12 .
12 .
13 . No-LFS LFS
13 . No-LFS LFS
14 . +----------------------------+
14 . +----------------------------+
15 . | || D | E | D | E |
15 . | || D | E | D | E |
16 . |---++=======================|
16 . |---++=======================|
17 . C | D || N/A | #1 | X | #4 |
17 . C | D || N/A | #1 | X | #4 |
18 . l No +---++-----------------------|
18 . l No +---++-----------------------|
19 . i LFS | E || #2 | #2 | X | #5 |
19 . i LFS | E || #2 | #2 | X | #5 |
20 . e +---++-----------------------|
20 . e +---++-----------------------|
21 . n | D || X | X | X | X |
21 . n | D || X | X | X | X |
22 . t LFS |---++-----------------------|
22 . t LFS |---++-----------------------|
23 . | E || #3 | #3 | X | #6 |
23 . | E || #3 | #3 | X | #6 |
24 . |---++-----------------------+
24 . |---++-----------------------+
25
25
26 make command server magic visible
26 make command server magic visible
27
27
28 #if windows
28 #if windows
29 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
29 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
30 #else
30 #else
31 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
31 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
32 #endif
32 #endif
33 $ export PYTHONPATH
33 $ export PYTHONPATH
34
34
35 $ hg init server
35 $ hg init server
36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires"
36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires"
37
37
38 $ cat > $TESTTMP/debugprocessors.py <<EOF
38 $ cat > $TESTTMP/debugprocessors.py <<EOF
39 > from mercurial import (
39 > from mercurial import (
40 > cmdutil,
40 > cmdutil,
41 > commands,
41 > commands,
42 > pycompat,
42 > pycompat,
43 > registrar,
43 > registrar,
44 > )
44 > )
45 > cmdtable = {}
45 > cmdtable = {}
46 > command = registrar.command(cmdtable)
46 > command = registrar.command(cmdtable)
47 > @command(b'debugprocessors', [], b'FILE')
47 > @command(b'debugprocessors', [], b'FILE')
48 > def debugprocessors(ui, repo, file_=None, **opts):
48 > def debugprocessors(ui, repo, file_=None, **opts):
49 > opts = pycompat.byteskwargs(opts)
49 > opts = pycompat.byteskwargs(opts)
50 > opts[b'changelog'] = False
50 > opts[b'changelog'] = False
51 > opts[b'manifest'] = False
51 > opts[b'manifest'] = False
52 > opts[b'dir'] = False
52 > opts[b'dir'] = False
53 > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts)
53 > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts)
54 > for flag, proc in rl._flagprocessors.items():
54 > for flag, proc in rl._flagprocessors.items():
55 > ui.status(b"registered processor '%#x'\n" % (flag))
55 > ui.status(b"registered processor '%#x'\n" % (flag))
56 > EOF
56 > EOF
57
57
58 Skip the experimental.changegroup3=True config. Failure to agree on this comes
58 Skip the experimental.changegroup3=True config. Failure to agree on this comes
59 first, and causes a "ValueError: no common changegroup version" or "abort:
59 first, and causes a "ValueError: no common changegroup version" or "abort:
60 HTTP Error 500: Internal Server Error", if the extension is only loaded on one
60 HTTP Error 500: Internal Server Error", if the extension is only loaded on one
61 side. If that *is* enabled, the subsequent failure is "abort: missing processor
61 side. If that *is* enabled, the subsequent failure is "abort: missing processor
62 for flag '0x2000'!" if the extension is only loaded on one side (possibly also
62 for flag '0x2000'!" if the extension is only loaded on one side (possibly also
63 masked by the Internal Server Error message).
63 masked by the Internal Server Error message).
64 $ cat >> $HGRCPATH <<EOF
64 $ cat >> $HGRCPATH <<EOF
65 > [extensions]
65 > [extensions]
66 > debugprocessors = $TESTTMP/debugprocessors.py
66 > debugprocessors = $TESTTMP/debugprocessors.py
67 > [experimental]
67 > [experimental]
68 > lfs.disableusercache = True
68 > lfs.disableusercache = True
69 > [lfs]
69 > [lfs]
70 > threshold=10
70 > threshold=10
71 > [web]
71 > [web]
72 > allow_push=*
72 > allow_push=*
73 > push_ssl=False
73 > push_ssl=False
74 > EOF
74 > EOF
75
75
76 $ cp $HGRCPATH $HGRCPATH.orig
76 $ cp $HGRCPATH $HGRCPATH.orig
77
77
78 #if lfsremote-on
78 #if lfsremote-on
79 $ hg --config extensions.lfs= -R server \
79 $ hg --config extensions.lfs= -R server \
80 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
80 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
81 #else
81 #else
82 $ hg --config extensions.lfs=! -R server \
82 $ hg --config extensions.lfs=! -R server \
83 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
83 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
84 #endif
84 #endif
85
85
86 $ cat hg.pid >> $DAEMON_PIDS
86 $ cat hg.pid >> $DAEMON_PIDS
87 $ hg clone -q http://localhost:$HGPORT client
87 $ hg clone -q http://localhost:$HGPORT client
88 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
88 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
89 [1]
89 [1]
90
90
91 This trivial repo will force commandserver to load the extension, but not call
91 This trivial repo will force commandserver to load the extension, but not call
92 reposetup() on another repo actually being operated on. This gives coverage
92 reposetup() on another repo actually being operated on. This gives coverage
93 that wrapper functions are not assuming reposetup() was called.
93 that wrapper functions are not assuming reposetup() was called.
94
94
95 $ hg init $TESTTMP/cmdservelfs
95 $ hg init $TESTTMP/cmdservelfs
96 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
96 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
97 > [extensions]
97 > [extensions]
98 > lfs =
98 > lfs =
99 > EOF
99 > EOF
100
100
101 --------------------------------------------------------------------------------
101 --------------------------------------------------------------------------------
102 Case #1: client with non-lfs content and the extension disabled; server with
102 Case #1: client with non-lfs content and the extension disabled; server with
103 non-lfs content, and the extension enabled.
103 non-lfs content, and the extension enabled.
104
104
105 $ cd client
105 $ cd client
106 $ echo 'non-lfs' > nonlfs.txt
106 $ echo 'non-lfs' > nonlfs.txt
107 >>> from __future__ import absolute_import
107 >>> from __future__ import absolute_import
108 >>> from hgclient import check, readchannel, runcommand
108 >>> from hgclient import check, readchannel, runcommand
109 >>> @check
109 >>> @check
110 ... def diff(server):
110 ... def diff(server):
111 ... readchannel(server)
111 ... readchannel(server)
112 ... # run an arbitrary command in the repo with the extension loaded
112 ... # run an arbitrary command in the repo with the extension loaded
113 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
113 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
114 ... # now run a command in a repo without the extension to ensure that
114 ... # now run a command in a repo without the extension to ensure that
115 ... # files are added safely..
115 ... # files are added safely..
116 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
116 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
117 ... # .. and that scmutil.prefetchfiles() safely no-ops..
117 ... # .. and that scmutil.prefetchfiles() safely no-ops..
118 ... runcommand(server, [b'diff', b'-r', b'.~1'])
118 ... runcommand(server, [b'diff', b'-r', b'.~1'])
119 ... # .. and that debugupgraderepo safely no-ops.
119 ... # .. and that debugupgraderepo safely no-ops.
120 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
120 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
121 *** runcommand id -R ../cmdservelfs
121 *** runcommand id -R ../cmdservelfs
122 000000000000 tip
122 000000000000 tip
123 *** runcommand ci -Aqm non-lfs
123 *** runcommand ci -Aqm non-lfs
124 *** runcommand diff -r .~1
124 *** runcommand diff -r .~1
125 diff -r 000000000000 nonlfs.txt
125 diff -r 000000000000 nonlfs.txt
126 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
126 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
127 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
127 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
128 @@ -0,0 +1,1 @@
128 @@ -0,0 +1,1 @@
129 +non-lfs
129 +non-lfs
130 *** runcommand debugupgraderepo -q --run
130 *** runcommand debugupgraderepo -q --run
131 upgrade will perform the following actions:
131 upgrade will perform the following actions:
132
132
133 requirements
133 requirements
134 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
134 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
135
135
136 beginning upgrade...
136 beginning upgrade...
137 repository locked and read-only
137 repository locked and read-only
138 creating temporary repository to stage migrated data: * (glob)
138 creating temporary repository to stage migrated data: * (glob)
139 (it is safe to interrupt this process any time before data migration completes)
139 (it is safe to interrupt this process any time before data migration completes)
140 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
140 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
141 migrating 324 bytes in store; 129 bytes tracked data
141 migrating 324 bytes in store; 129 bytes tracked data
142 migrating 1 filelogs containing 1 revisions (73 bytes in store; 8 bytes tracked data)
142 migrating 1 filelogs containing 1 revisions (73 bytes in store; 8 bytes tracked data)
143 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
143 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
144 migrating 1 manifests containing 1 revisions (117 bytes in store; 52 bytes tracked data)
144 migrating 1 manifests containing 1 revisions (117 bytes in store; 52 bytes tracked data)
145 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
145 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
146 migrating changelog containing 1 revisions (134 bytes in store; 69 bytes tracked data)
146 migrating changelog containing 1 revisions (134 bytes in store; 69 bytes tracked data)
147 finished migrating 1 changelog revisions; change in size: 0 bytes
147 finished migrating 1 changelog revisions; change in size: 0 bytes
148 finished migrating 3 total revisions; total change in store size: 0 bytes
148 finished migrating 3 total revisions; total change in store size: 0 bytes
149 copying phaseroots
149 copying phaseroots
150 data fully migrated to temporary repository
150 data fully migrated to temporary repository
151 marking source repository as being upgraded; clients will be unable to read from repository
151 marking source repository as being upgraded; clients will be unable to read from repository
152 starting in-place swap of repository data
152 starting in-place swap of repository data
153 replaced files will be backed up at * (glob)
153 replaced files will be backed up at * (glob)
154 replacing store...
154 replacing store...
155 store replacement complete; repository was inconsistent for *s (glob)
155 store replacement complete; repository was inconsistent for *s (glob)
156 finalizing requirements file and making repository readable again
156 finalizing requirements file and making repository readable again
157 removing temporary repository * (glob)
157 removing temporary repository * (glob)
158 copy of old repository backed up at * (glob)
158 copy of old repository backed up at * (glob)
159 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
159 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
160
160
161 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
161 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
162 [1]
162 [1]
163
163
164 #if lfsremote-on
164 #if lfsremote-on
165
165
166 $ hg push -q
166 $ hg push -q
167 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
167 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
168 [1]
168 [1]
169
169
170 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
170 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
171 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
171 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
172 [1]
172 [1]
173
173
174 $ hg init $TESTTMP/client1_pull
174 $ hg init $TESTTMP/client1_pull
175 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
175 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
176 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
176 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
177 [1]
177 [1]
178
178
179 $ hg identify http://localhost:$HGPORT
179 $ hg identify http://localhost:$HGPORT
180 d437e1d24fbd
180 d437e1d24fbd
181
181
182 #endif
182 #endif
183
183
184 --------------------------------------------------------------------------------
184 --------------------------------------------------------------------------------
185 Case #2: client with non-lfs content and the extension enabled; server with
185 Case #2: client with non-lfs content and the extension enabled; server with
186 non-lfs content, and the extension state controlled by #testcases.
186 non-lfs content, and the extension state controlled by #testcases.
187
187
188 $ cat >> $HGRCPATH <<EOF
188 $ cat >> $HGRCPATH <<EOF
189 > [extensions]
189 > [extensions]
190 > lfs =
190 > lfs =
191 > EOF
191 > EOF
192 $ echo 'non-lfs' > nonlfs2.txt
192 $ echo 'non-lfs' > nonlfs2.txt
193 $ hg ci -Aqm 'non-lfs file with lfs client'
193 $ hg ci -Aqm 'non-lfs file with lfs client'
194
194
195 Since no lfs content has been added yet, the push is allowed, even when the
195 Since no lfs content has been added yet, the push is allowed, even when the
196 extension is not enabled remotely.
196 extension is not enabled remotely.
197
197
198 $ hg push -q
198 $ hg push -q
199 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
199 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
200 [1]
200 [1]
201
201
202 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
202 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
203 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
203 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
204 [1]
204 [1]
205
205
206 $ hg init $TESTTMP/client2_pull
206 $ hg init $TESTTMP/client2_pull
207 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
207 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
208 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
208 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
209 [1]
209 [1]
210
210
211 $ hg identify http://localhost:$HGPORT
211 $ hg identify http://localhost:$HGPORT
212 1477875038c6
212 1477875038c6
213
213
214 --------------------------------------------------------------------------------
214 --------------------------------------------------------------------------------
215 Case #3: client with lfs content and the extension enabled; server with
215 Case #3: client with lfs content and the extension enabled; server with
216 non-lfs content, and the extension state controlled by #testcases. The server
216 non-lfs content, and the extension state controlled by #testcases. The server
217 should have an 'lfs' requirement after it picks up its first commit with a blob.
217 should have an 'lfs' requirement after it picks up its first commit with a blob.
218
218
219 $ echo 'this is a big lfs file' > lfs.bin
219 $ echo 'this is a big lfs file' > lfs.bin
220 $ hg ci -Aqm 'lfs'
220 $ hg ci -Aqm 'lfs'
221 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
221 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
222 .hg/requires:lfs
222 .hg/requires:lfs
223
223
224 #if lfsremote-off
224 #if lfsremote-off
225 $ hg push -q
225 $ hg push -q
226 abort: required features are not supported in the destination: lfs
226 abort: required features are not supported in the destination: lfs
227 (enable the lfs extension on the server)
227 (enable the lfs extension on the server)
228 [255]
228 [255]
229 #else
229 #else
230 $ hg push -q
230 $ hg push -q
231 #endif
231 #endif
232 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
232 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
233 .hg/requires:lfs
233 .hg/requires:lfs
234 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
234 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
235
235
236 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
236 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
237 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
237 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
238 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
238 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
239 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
239 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
240
240
241 $ hg init $TESTTMP/client3_pull
241 $ hg init $TESTTMP/client3_pull
242 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
242 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
243 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
243 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
244 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
244 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
245 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
245 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
246
246
247 Test that the commit/changegroup requirement check hook can be run multiple
247 Test that the commit/changegroup requirement check hook can be run multiple
248 times.
248 times.
249
249
250 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
250 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
251
251
252 $ cd ../cmdserve_client3
252 $ cd ../cmdserve_client3
253
253
254 >>> from __future__ import absolute_import
254 >>> from __future__ import absolute_import
255 >>> from hgclient import check, readchannel, runcommand
255 >>> from hgclient import check, readchannel, runcommand
256 >>> @check
256 >>> @check
257 ... def addrequirement(server):
257 ... def addrequirement(server):
258 ... readchannel(server)
258 ... readchannel(server)
259 ... # change the repo in a way that adds the lfs requirement
259 ... # change the repo in a way that adds the lfs requirement
260 ... runcommand(server, [b'pull', b'-qu'])
260 ... runcommand(server, [b'pull', b'-qu'])
261 ... # Now cause the requirement adding hook to fire again, without going
261 ... # Now cause the requirement adding hook to fire again, without going
262 ... # through reposetup() again.
262 ... # through reposetup() again.
263 ... with open('file.txt', 'wb') as fp:
263 ... with open('file.txt', 'wb') as fp:
264 ... fp.write(b'data')
264 ... fp.write(b'data')
265 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
265 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
266 *** runcommand pull -qu
266 *** runcommand pull -qu
267 *** runcommand ci -Aqm non-lfs
267 *** runcommand ci -Aqm non-lfs
268
268
269 $ cd ../client
269 $ cd ../client
270
270
271 The difference here is the push failed above when the extension isn't
271 The difference here is the push failed above when the extension isn't
272 enabled on the server.
272 enabled on the server.
273 $ hg identify http://localhost:$HGPORT
273 $ hg identify http://localhost:$HGPORT
274 8374dc4052cb (lfsremote-on !)
274 8374dc4052cb (lfsremote-on !)
275 1477875038c6 (lfsremote-off !)
275 1477875038c6 (lfsremote-off !)
276
276
277 Don't bother testing the lfsremote-off cases- the server won't be able
277 Don't bother testing the lfsremote-off cases- the server won't be able
278 to launch if there's lfs content and the extension is disabled.
278 to launch if there's lfs content and the extension is disabled.
279
279
280 #if lfsremote-on
280 #if lfsremote-on
281
281
282 --------------------------------------------------------------------------------
282 --------------------------------------------------------------------------------
283 Case #4: client with non-lfs content and the extension disabled; server with
283 Case #4: client with non-lfs content and the extension disabled; server with
284 lfs content, and the extension enabled.
284 lfs content, and the extension enabled.
285
285
286 $ cat >> $HGRCPATH <<EOF
286 $ cat >> $HGRCPATH <<EOF
287 > [extensions]
287 > [extensions]
288 > lfs = !
288 > lfs = !
289 > EOF
289 > EOF
290
290
291 $ hg init $TESTTMP/client4
291 $ hg init $TESTTMP/client4
292 $ cd $TESTTMP/client4
292 $ cd $TESTTMP/client4
293 $ cat >> .hg/hgrc <<EOF
293 $ cat >> .hg/hgrc <<EOF
294 > [paths]
294 > [paths]
295 > default = http://localhost:$HGPORT
295 > default = http://localhost:$HGPORT
296 > EOF
296 > EOF
297 $ echo 'non-lfs' > nonlfs2.txt
297 $ echo 'non-lfs' > nonlfs2.txt
298 $ hg ci -Aqm 'non-lfs'
298 $ hg ci -Aqm 'non-lfs'
299 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
299 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
300 $TESTTMP/server/.hg/requires:lfs
300 $TESTTMP/server/.hg/requires:lfs
301
301
302 $ hg push -q --force
302 $ hg push -q --force
303 warning: repository is unrelated
303 warning: repository is unrelated
304 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
304 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
305 $TESTTMP/server/.hg/requires:lfs
305 $TESTTMP/server/.hg/requires:lfs
306
306
307 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
307 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
308 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
308 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
309 abort: repository requires features unknown to this Mercurial: lfs!
309 abort: repository requires features unknown to this Mercurial: lfs!
310 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
310 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
311 [255]
311 [255]
312 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
312 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
313 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
313 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
314 $TESTTMP/server/.hg/requires:lfs
314 $TESTTMP/server/.hg/requires:lfs
315 [2]
315 [2]
316
316
317 TODO: fail more gracefully.
317 TODO: fail more gracefully.
318
318
319 $ hg init $TESTTMP/client4_pull
319 $ hg init $TESTTMP/client4_pull
320 $ hg -R $TESTTMP/client4_pull pull -q http://localhost:$HGPORT
320 $ hg -R $TESTTMP/client4_pull pull -q http://localhost:$HGPORT
321 abort: HTTP Error 500: Internal Server Error
321 abort: HTTP Error 500: Internal Server Error
322 [255]
322 [255]
323 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
323 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
324 $TESTTMP/server/.hg/requires:lfs
324 $TESTTMP/server/.hg/requires:lfs
325
325
326 $ hg identify http://localhost:$HGPORT
326 $ hg identify http://localhost:$HGPORT
327 03b080fa9d93
327 03b080fa9d93
328
328
329 --------------------------------------------------------------------------------
329 --------------------------------------------------------------------------------
330 Case #5: client with non-lfs content and the extension enabled; server with
330 Case #5: client with non-lfs content and the extension enabled; server with
331 lfs content, and the extension enabled.
331 lfs content, and the extension enabled.
332
332
333 $ cat >> $HGRCPATH <<EOF
333 $ cat >> $HGRCPATH <<EOF
334 > [extensions]
334 > [extensions]
335 > lfs =
335 > lfs =
336 > EOF
336 > EOF
337 $ echo 'non-lfs' > nonlfs3.txt
337 $ echo 'non-lfs' > nonlfs3.txt
338 $ hg ci -Aqm 'non-lfs file with lfs client'
338 $ hg ci -Aqm 'non-lfs file with lfs client'
339
339
340 $ hg push -q
340 $ hg push -q
341 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
341 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
342 $TESTTMP/server/.hg/requires:lfs
342 $TESTTMP/server/.hg/requires:lfs
343
343
344 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
344 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
345 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
345 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
346 $TESTTMP/client5_clone/.hg/requires:lfs
346 $TESTTMP/client5_clone/.hg/requires:lfs
347 $TESTTMP/server/.hg/requires:lfs
347 $TESTTMP/server/.hg/requires:lfs
348
348
349 $ hg init $TESTTMP/client5_pull
349 $ hg init $TESTTMP/client5_pull
350 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
350 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
351 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
351 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
352 $TESTTMP/client5_pull/.hg/requires:lfs
352 $TESTTMP/client5_pull/.hg/requires:lfs
353 $TESTTMP/server/.hg/requires:lfs
353 $TESTTMP/server/.hg/requires:lfs
354
354
355 $ hg identify http://localhost:$HGPORT
355 $ hg identify http://localhost:$HGPORT
356 c729025cc5e3
356 c729025cc5e3
357
357
358 $ mv $HGRCPATH $HGRCPATH.tmp
358 $ mv $HGRCPATH $HGRCPATH.tmp
359 $ cp $HGRCPATH.orig $HGRCPATH
359 $ cp $HGRCPATH.orig $HGRCPATH
360
360
361 >>> from __future__ import absolute_import
361 >>> from __future__ import absolute_import
362 >>> from hgclient import check, readchannel, runcommand
362 >>> from hgclient import check, readchannel, runcommand
363 >>> @check
363 >>> @check
364 ... def checkflags(server):
364 ... def checkflags(server):
365 ... readchannel(server)
365 ... readchannel(server)
366 ... print('')
366 ... print('')
367 ... print('# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
367 ... print('# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
368 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
368 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
369 ... b'../server'])
369 ... b'../server'])
370 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
370 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
371 ... b'../server'])
371 ... b'../server'])
372 ... runcommand(server, [b'config', b'extensions', b'--cwd',
372 ... runcommand(server, [b'config', b'extensions', b'--cwd',
373 ... b'../server'])
373 ... b'../server'])
374 ...
374 ...
375 ... print("\n# LFS not enabled- revlogs don't have 0x2000 flag")
375 ... print("\n# LFS not enabled- revlogs don't have 0x2000 flag")
376 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
376 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
377 ... runcommand(server, [b'config', b'extensions'])
377 ... runcommand(server, [b'config', b'extensions'])
378
378
379 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
379 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
380 *** runcommand debugprocessors lfs.bin -R ../server
380 *** runcommand debugprocessors lfs.bin -R ../server
381 registered processor '0x8000'
381 registered processor '0x8000'
382 registered processor '0x2000'
382 registered processor '0x2000'
383 *** runcommand debugprocessors nonlfs2.txt -R ../server
383 *** runcommand debugprocessors nonlfs2.txt -R ../server
384 registered processor '0x8000'
384 registered processor '0x8000'
385 registered processor '0x2000'
385 registered processor '0x2000'
386 *** runcommand config extensions --cwd ../server
386 *** runcommand config extensions --cwd ../server
387 extensions.debugprocessors=$TESTTMP/debugprocessors.py
387 extensions.debugprocessors=$TESTTMP/debugprocessors.py
388 extensions.lfs=
388 extensions.lfs=
389
389
390 # LFS not enabled- revlogs don't have 0x2000 flag
390 # LFS not enabled- revlogs don't have 0x2000 flag
391 *** runcommand debugprocessors nonlfs3.txt
391 *** runcommand debugprocessors nonlfs3.txt
392 registered processor '0x8000'
392 registered processor '0x8000'
393 *** runcommand config extensions
393 *** runcommand config extensions
394 extensions.debugprocessors=$TESTTMP/debugprocessors.py
394 extensions.debugprocessors=$TESTTMP/debugprocessors.py
395
395
396 $ rm $HGRCPATH
396 $ rm $HGRCPATH
397 $ mv $HGRCPATH.tmp $HGRCPATH
397 $ mv $HGRCPATH.tmp $HGRCPATH
398
398
399 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
399 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
400 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
400 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
401 > [extensions]
401 > [extensions]
402 > lfs = !
402 > lfs = !
403 > EOF
403 > EOF
404
404
405 >>> from __future__ import absolute_import, print_function
405 >>> from __future__ import absolute_import, print_function
406 >>> from hgclient import check, readchannel, runcommand
406 >>> from hgclient import check, readchannel, runcommand
407 >>> @check
407 >>> @check
408 ... def checkflags2(server):
408 ... def checkflags2(server):
409 ... readchannel(server)
409 ... readchannel(server)
410 ... print('')
410 ... print('')
411 ... print('# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
411 ... print('# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
412 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
412 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
413 ... b'../server'])
413 ... b'../server'])
414 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
414 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
415 ... b'../server'])
415 ... b'../server'])
416 ... runcommand(server, [b'config', b'extensions', b'--cwd',
416 ... runcommand(server, [b'config', b'extensions', b'--cwd',
417 ... b'../server'])
417 ... b'../server'])
418 ...
418 ...
419 ... print('\n# LFS enabled without requirement- revlogs have 0x2000 flag')
419 ... print('\n# LFS enabled without requirement- revlogs have 0x2000 flag')
420 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
420 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
421 ... runcommand(server, [b'config', b'extensions'])
421 ... runcommand(server, [b'config', b'extensions'])
422 ...
422 ...
423 ... print("\n# LFS disabled locally- revlogs don't have 0x2000 flag")
423 ... print("\n# LFS disabled locally- revlogs don't have 0x2000 flag")
424 ... runcommand(server, ['debugprocessors', 'nonlfs.txt', '-R',
424 ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
425 ... '../nonlfs'])
425 ... b'../nonlfs'])
426 ... runcommand(server, ['config', 'extensions', '--cwd',
426 ... runcommand(server, [b'config', b'extensions', b'--cwd',
427 ... '../nonlfs'])
427 ... b'../nonlfs'])
428
428
429 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
429 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
430 *** runcommand debugprocessors lfs.bin -R ../server
430 *** runcommand debugprocessors lfs.bin -R ../server
431 registered processor '0x8000'
431 registered processor '0x8000'
432 registered processor '0x2000'
432 registered processor '0x2000'
433 *** runcommand debugprocessors nonlfs2.txt -R ../server
433 *** runcommand debugprocessors nonlfs2.txt -R ../server
434 registered processor '0x8000'
434 registered processor '0x8000'
435 registered processor '0x2000'
435 registered processor '0x2000'
436 *** runcommand config extensions --cwd ../server
436 *** runcommand config extensions --cwd ../server
437 extensions.debugprocessors=$TESTTMP/debugprocessors.py
437 extensions.debugprocessors=$TESTTMP/debugprocessors.py
438 extensions.lfs=
438 extensions.lfs=
439
439
440 # LFS enabled without requirement- revlogs have 0x2000 flag
440 # LFS enabled without requirement- revlogs have 0x2000 flag
441 *** runcommand debugprocessors nonlfs3.txt
441 *** runcommand debugprocessors nonlfs3.txt
442 registered processor '0x8000'
442 registered processor '0x8000'
443 registered processor '0x2000'
443 registered processor '0x2000'
444 *** runcommand config extensions
444 *** runcommand config extensions
445 extensions.debugprocessors=$TESTTMP/debugprocessors.py
445 extensions.debugprocessors=$TESTTMP/debugprocessors.py
446 extensions.lfs=
446 extensions.lfs=
447
447
448 # LFS disabled locally- revlogs don't have 0x2000 flag
448 # LFS disabled locally- revlogs don't have 0x2000 flag
449 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
449 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
450 registered processor '0x8000'
450 registered processor '0x8000'
451 *** runcommand config extensions --cwd ../nonlfs
451 *** runcommand config extensions --cwd ../nonlfs
452 extensions.debugprocessors=$TESTTMP/debugprocessors.py
452 extensions.debugprocessors=$TESTTMP/debugprocessors.py
453 extensions.lfs=!
453 extensions.lfs=!
454
454
455 --------------------------------------------------------------------------------
455 --------------------------------------------------------------------------------
456 Case #6: client with lfs content and the extension enabled; server with
456 Case #6: client with lfs content and the extension enabled; server with
457 lfs content, and the extension enabled.
457 lfs content, and the extension enabled.
458
458
459 $ echo 'this is another lfs file' > lfs2.txt
459 $ echo 'this is another lfs file' > lfs2.txt
460 $ hg ci -Aqm 'lfs file with lfs client'
460 $ hg ci -Aqm 'lfs file with lfs client'
461
461
462 $ hg --config paths.default= push -v http://localhost:$HGPORT
462 $ hg --config paths.default= push -v http://localhost:$HGPORT
463 pushing to http://localhost:$HGPORT/
463 pushing to http://localhost:$HGPORT/
464 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
464 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
465 searching for changes
465 searching for changes
466 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
466 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
467 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
467 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
468 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
468 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
469 lfs: uploaded 1 files (25 bytes)
469 lfs: uploaded 1 files (25 bytes)
470 1 changesets found
470 1 changesets found
471 uncompressed size of bundle content:
471 uncompressed size of bundle content:
472 206 (changelog)
472 206 (changelog)
473 172 (manifests)
473 172 (manifests)
474 275 lfs2.txt
474 275 lfs2.txt
475 remote: adding changesets
475 remote: adding changesets
476 remote: adding manifests
476 remote: adding manifests
477 remote: adding file changes
477 remote: adding file changes
478 remote: added 1 changesets with 1 changes to 1 files
478 remote: added 1 changesets with 1 changes to 1 files
479 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
479 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
480 .hg/requires:lfs
480 .hg/requires:lfs
481 $TESTTMP/server/.hg/requires:lfs
481 $TESTTMP/server/.hg/requires:lfs
482
482
483 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
483 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
484 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
484 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
485 $TESTTMP/client6_clone/.hg/requires:lfs
485 $TESTTMP/client6_clone/.hg/requires:lfs
486 $TESTTMP/server/.hg/requires:lfs
486 $TESTTMP/server/.hg/requires:lfs
487
487
488 $ hg init $TESTTMP/client6_pull
488 $ hg init $TESTTMP/client6_pull
489 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
489 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
490 pulling from http://localhost:$HGPORT/
490 pulling from http://localhost:$HGPORT/
491 requesting all changes
491 requesting all changes
492 adding changesets
492 adding changesets
493 adding manifests
493 adding manifests
494 adding file changes
494 adding file changes
495 added 6 changesets with 5 changes to 5 files (+1 heads)
495 added 6 changesets with 5 changes to 5 files (+1 heads)
496 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
496 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
497 new changesets d437e1d24fbd:d3b84d50eacb
497 new changesets d437e1d24fbd:d3b84d50eacb
498 resolving manifests
498 resolving manifests
499 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
499 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
500 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
500 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
501 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
501 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
502 lfs: downloaded 1 files (25 bytes)
502 lfs: downloaded 1 files (25 bytes)
503 getting lfs2.txt
503 getting lfs2.txt
504 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
504 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
505 getting nonlfs2.txt
505 getting nonlfs2.txt
506 getting nonlfs3.txt
506 getting nonlfs3.txt
507 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
507 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
508 updated to "d3b84d50eacb: lfs file with lfs client"
508 updated to "d3b84d50eacb: lfs file with lfs client"
509 1 other heads for branch "default"
509 1 other heads for branch "default"
510 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
510 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
511 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
511 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
512 $TESTTMP/client6_pull/.hg/requires:lfs
512 $TESTTMP/client6_pull/.hg/requires:lfs
513 $TESTTMP/server/.hg/requires:lfs
513 $TESTTMP/server/.hg/requires:lfs
514
514
515 $ hg identify http://localhost:$HGPORT
515 $ hg identify http://localhost:$HGPORT
516 d3b84d50eacb
516 d3b84d50eacb
517
517
518 --------------------------------------------------------------------------------
518 --------------------------------------------------------------------------------
519 Misc: process dies early if a requirement exists and the extension is disabled
519 Misc: process dies early if a requirement exists and the extension is disabled
520
520
521 $ hg --config extensions.lfs=! summary
521 $ hg --config extensions.lfs=! summary
522 abort: repository requires features unknown to this Mercurial: lfs!
522 abort: repository requires features unknown to this Mercurial: lfs!
523 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
523 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
524 [255]
524 [255]
525
525
526 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
526 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
527 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
527 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
528 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
528 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
529 $ hg -R $TESTTMP/client6_clone push -q
529 $ hg -R $TESTTMP/client6_clone push -q
530
530
531 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
531 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
532
532
533 Export will prefetch all needed files across all needed revisions
533 Export will prefetch all needed files across all needed revisions
534
534
535 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
535 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
536 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
536 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
537 exporting patches:
537 exporting patches:
538 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
538 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
539 lfs: need to transfer 4 objects (92 bytes)
539 lfs: need to transfer 4 objects (92 bytes)
540 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
540 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
541 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
541 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
542 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
542 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
543 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
543 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
544 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
544 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
545 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
545 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
546 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
546 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
547 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
547 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
548 lfs: downloaded 4 files (92 bytes)
548 lfs: downloaded 4 files (92 bytes)
549 all.export
549 all.export
550 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
550 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
551 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
551 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
552 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
552 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
553 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
553 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
554
554
555 Export with selected files is used with `extdiff --patch`
555 Export with selected files is used with `extdiff --patch`
556
556
557 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
557 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
558 $ hg --config extensions.extdiff= \
558 $ hg --config extensions.extdiff= \
559 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
559 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
560 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
560 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
561 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
561 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
562 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
562 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
563 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
563 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
564 lfs: downloaded 1 files (23 bytes)
564 lfs: downloaded 1 files (23 bytes)
565 */hg-8374dc4052cb.patch (glob)
565 */hg-8374dc4052cb.patch (glob)
566 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
566 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
567 */hg-9640b57e77b1.patch (glob)
567 */hg-9640b57e77b1.patch (glob)
568 --- */hg-8374dc4052cb.patch * (glob)
568 --- */hg-8374dc4052cb.patch * (glob)
569 +++ */hg-9640b57e77b1.patch * (glob)
569 +++ */hg-9640b57e77b1.patch * (glob)
570 @@ -2,12 +2,7 @@
570 @@ -2,12 +2,7 @@
571 # User test
571 # User test
572 # Date 0 0
572 # Date 0 0
573 # Thu Jan 01 00:00:00 1970 +0000
573 # Thu Jan 01 00:00:00 1970 +0000
574 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
574 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
575 -# Parent 1477875038c60152e391238920a16381c627b487
575 -# Parent 1477875038c60152e391238920a16381c627b487
576 -lfs
576 -lfs
577 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
577 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
578 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
578 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
579 +add lfs pair
579 +add lfs pair
580
580
581 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
581 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
582 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
582 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
583 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
583 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
584 -@@ -0,0 +1,1 @@
584 -@@ -0,0 +1,1 @@
585 -+this is a big lfs file
585 -+this is a big lfs file
586 cleaning up temp directory
586 cleaning up temp directory
587 [1]
587 [1]
588
588
589 Diff will prefetch files
589 Diff will prefetch files
590
590
591 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
591 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
592 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
592 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
593 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
593 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
594 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
594 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
595 lfs: need to transfer 4 objects (92 bytes)
595 lfs: need to transfer 4 objects (92 bytes)
596 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
596 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
597 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
597 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
598 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
598 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
599 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
599 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
600 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
600 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
601 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
601 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
602 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
602 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
603 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
603 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
604 lfs: downloaded 4 files (92 bytes)
604 lfs: downloaded 4 files (92 bytes)
605 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
605 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
606 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
606 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
607 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
607 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
608 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
608 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
609 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
609 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
610 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
610 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
611 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
611 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
612 @@ -1,1 +0,0 @@
612 @@ -1,1 +0,0 @@
613 -this is a big lfs file
613 -this is a big lfs file
614 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
614 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
615 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
615 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
616 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
616 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
617 @@ -0,0 +1,1 @@
617 @@ -0,0 +1,1 @@
618 +this is another lfs file
618 +this is another lfs file
619 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
619 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
620 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
620 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
621 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
621 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
622 @@ -0,0 +1,1 @@
622 @@ -0,0 +1,1 @@
623 +this is an lfs file
623 +this is an lfs file
624 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
624 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
625 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
625 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
626 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
626 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
627 @@ -0,0 +1,1 @@
627 @@ -0,0 +1,1 @@
628 +this is an lfs file too
628 +this is an lfs file too
629 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
629 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
630 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
630 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
631 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
631 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
632 @@ -1,1 +0,0 @@
632 @@ -1,1 +0,0 @@
633 -non-lfs
633 -non-lfs
634 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
634 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
635 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
635 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
636 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
636 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
637 @@ -0,0 +1,1 @@
637 @@ -0,0 +1,1 @@
638 +non-lfs
638 +non-lfs
639
639
640 Only the files required by diff are prefetched
640 Only the files required by diff are prefetched
641
641
642 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
642 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
643 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
643 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
644 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
644 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
645 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
645 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
646 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
646 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
647 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
647 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
648 lfs: downloaded 1 files (24 bytes)
648 lfs: downloaded 1 files (24 bytes)
649 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
649 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
650 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
650 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
651 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
651 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
652 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
652 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
653 @@ -0,0 +1,1 @@
653 @@ -0,0 +1,1 @@
654 +this is an lfs file too
654 +this is an lfs file too
655
655
656 #endif
656 #endif
657
657
658 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
658 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
659
659
660 #if lfsremote-on
660 #if lfsremote-on
661 $ cat $TESTTMP/errors.log | grep '^[A-Z]'
661 $ cat $TESTTMP/errors.log | grep '^[A-Z]'
662 Traceback (most recent call last):
662 Traceback (most recent call last):
663 ValueError: no common changegroup version
663 ValueError: no common changegroup version
664 #else
664 #else
665 $ cat $TESTTMP/errors.log
665 $ cat $TESTTMP/errors.log
666 #endif
666 #endif
General Comments 0
You need to be logged in to leave comments. Login now