Mercurial > hg
annotate tests/test-sparse-requirement.t @ 43457:92e24a139ecc stable
py3: compare http server's command with a native string
The "command" attribute is an str, so comparing with a bytes would not
work on Python 3. This might solve issues in test-lfs-serve-access.t
that happens sometimes (especially in CI):
--- /hgwork/src/tests/test-lfs-serve-access.t
+++ /hgwork/src/tests/test-lfs-serve-access.t.err
@@ -163,11 +163,13 @@
$ cat $TESTTMP/access.log $TESTTMP/errors.log
$LOCALIP - - [$LOGDATE$] "POST /missing/objects/batch HTTP/1.1" 404 - (glob)
+ $LOCALIP - - [05/Nov/2019 16:32:34] "{"objects": [{"oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e", "size": 20}], "operation": "download"}" HTTPStatus.BAD_REQUEST -
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=capabilities HTTP/1.1" 200 - (glob)
$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)
$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)
$LOCALIP - - [$LOGDATE$] "POST /subdir/mount/point/.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e HTTP/1.1" 200 - (glob)
+ $LOCALIP - - [05/Nov/2019 16:32:34] code 400, message Bad request version ('"download"}')
Blobs that already exist in the usercache are linked into the repo store, even
though the client doesn't send the blob.
@@ -195,6 +197,7 @@
server2/.hg/store/lfs/objects/f0/3217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
$ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
$ cat $TESTTMP/errors.log
+ $LOCALIP - - [05/Nov/2019 16:32:34] code 400, message Bad request version ('"download"}')
$ cat >> $TESTTMP/lfsstoreerror.py <<EOF
> import errno
(from https://ci.hg.gregoryszorc.com/job-info/hg-committed-ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb-debian10-cpython-3.7-0)
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Thu, 07 Nov 2019 08:58:26 +0100 |
parents | a0886a4d6dce |
children | 5c2a4f37eace |
rev | line source |
---|---|
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 $ hg init repo |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 $ cd repo |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 $ touch a.html b.html c.py d.py |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 $ cat > frontend.sparse << EOF |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 > [include] |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 > *.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 > EOF |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 $ hg -q commit -A -m initial |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 $ echo 1 > a.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 $ echo 1 > c.py |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 $ hg commit -m 'commit 1' |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 Enable sparse profile |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 $ cat .hg/requires |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 dotencode |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 fncache |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 generaldelta |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 revlogv1 |
40907
74a519c86625
test: enable sparse-revlog for test-sparse-requirement.t
Boris Feld <boris.feld@octobus.net>
parents:
37415
diff
changeset
|
24 sparserevlog |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 store |
37415
c2c8962a9465
simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33556
diff
changeset
|
26 testonly-simplestore (reposimplestore !) |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 $ hg debugsparse --config extensions.sparse= --enable-profile frontend.sparse |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 $ ls |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
30 a.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
31 b.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 Requirement for sparse added when sparse is enabled |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 $ cat .hg/requires |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 dotencode |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
37 exp-sparse |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 fncache |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
39 generaldelta |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 revlogv1 |
40907
74a519c86625
test: enable sparse-revlog for test-sparse-requirement.t
Boris Feld <boris.feld@octobus.net>
parents:
37415
diff
changeset
|
41 sparserevlog |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
42 store |
37415
c2c8962a9465
simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33556
diff
changeset
|
43 testonly-simplestore (reposimplestore !) |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 Client without sparse enabled reacts properly |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
47 $ hg files |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
48 abort: repository is using sparse feature but sparse is not enabled; enable the "sparse" extensions to access! |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 [255] |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
51 Requirement for sparse is removed when sparse is disabled |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
52 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
53 $ hg debugsparse --reset --config extensions.sparse= |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
54 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
55 $ cat .hg/requires |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
56 dotencode |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
57 fncache |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
58 generaldelta |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
59 revlogv1 |
40907
74a519c86625
test: enable sparse-revlog for test-sparse-requirement.t
Boris Feld <boris.feld@octobus.net>
parents:
37415
diff
changeset
|
60 sparserevlog |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
61 store |
37415
c2c8962a9465
simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33556
diff
changeset
|
62 testonly-simplestore (reposimplestore !) |
33556
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
63 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
64 And client without sparse can access |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
65 |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
66 $ hg files |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
67 a.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
68 b.html |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
69 c.py |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
70 d.py |
22371eabb3b1
sparse: add a requirement when a repository uses sparse (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
71 frontend.sparse |