annotate tests/test-sparse-clone.t @ 48598:a6f16ec07ed7

stream-clone: add a explicit test for format change during stream clone They are different kind of requirements, the one which impact the data storage and are relevant to the files being streamed and the one which does not. For example some requirements are only relevant to the working copy, like sparse, or dirstate-v2. Since they are irrelevant to the content being streamed, they do not prevent the receiving side to use streaming clone and mercurial skip adverting them over the wire and, ideally, within the bundle. In addition, this let the client decide to use whichever format it desire for the part that does not affect the store itself. So the configuration related to these format are used as normal when doing a streaming clone. In practice, the feature was not really tested and is badly broken with bundle-2, since the requirements are not filtered out from the stream bundle. So we start with adding simple tests as a good base before the fix and adjust the feature. Differential Revision: https://phab.mercurial-scm.org/D12029
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 17 Jan 2022 18:51:47 +0100
parents 9c4204b7f3e4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
1 test sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
2
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
3 $ cat >> $HGRCPATH << EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
4 > [ui]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
5 > username = nobody <no.reply@fb.com>
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
6 > [extensions]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
7 > sparse=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
8 > purge=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
9 > strip=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
10 > rebase=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
11 > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
12
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
13 $ hg init myrepo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
14 $ cd myrepo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
15 $ echo a > index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
16 $ echo x > data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
17 $ echo z > readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
18 $ cat > webpage.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
19 > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
20 > *.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
21 > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
22 $ cat > backend.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
23 > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
24 > *.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
25 > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
26 $ hg ci -Aqm 'initial'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
27 $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
28
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
29 Verify local clone with a sparse profile works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
30
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
31 $ hg clone --enable-profile webpage.sparse myrepo clone1
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
32 updating to branch default
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
33 warning: sparse profile 'webpage.sparse' not found in rev 000000000000 - ignoring it
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
34 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
35 $ cd clone1
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
36 $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
37 .hg
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
38 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
39 $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
40
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
41 Verify local clone with include works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
42
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
43 $ hg clone --include *.sparse myrepo clone2
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
44 updating to branch default
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
46 $ cd clone2
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
47 $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
48 .hg
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
49 backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
50 webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
51 $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
52
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
53 Verify local clone with exclude works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
54
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
55 $ hg clone --exclude data.py myrepo clone3
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
56 updating to branch default
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
57 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
58 $ cd clone3
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
59 $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
60 .hg
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
61 backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
62 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
63 readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
64 webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
65 $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
66
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
67 Verify sparse clone profile over ssh works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
68
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
69 $ hg clone -q --enable-profile webpage.sparse ssh://user@dummy/myrepo clone4
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
70 warning: sparse profile 'webpage.sparse' not found in rev 000000000000 - ignoring it
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
71 $ cd clone4
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
72 $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
73 .hg
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
74 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
75 $ cd ..