Show More
@@ -1,53 +1,53 | |||||
1 | Test attempting a narrow clone against a server that doesn't support narrowhg. |
|
1 | Test attempting a narrow clone against a server that doesn't support narrowhg. | |
2 |
|
2 | |||
3 | $ . "$TESTDIR/narrow-library.sh" |
|
3 | $ . "$TESTDIR/narrow-library.sh" | |
4 |
|
4 | |||
5 | $ hg init master |
|
5 | $ hg init master | |
6 | $ cd master |
|
6 | $ cd master | |
7 |
|
7 | |||
8 | $ for x in `$TESTDIR/seq.py 10`; do |
|
8 | $ for x in `$TESTDIR/seq.py 10`; do | |
9 | > echo $x > "f$x" |
|
9 | > echo $x > "f$x" | |
10 | > hg add "f$x" |
|
10 | > hg add "f$x" | |
11 | > hg commit -m "Add $x" |
|
11 | > hg commit -m "Add $x" | |
12 | > done |
|
12 | > done | |
13 |
|
13 | |||
14 | $ hg serve -a localhost -p $HGPORT1 --config extensions.narrow=! -d \ |
|
14 | $ hg serve -a localhost -p $HGPORT1 --config extensions.narrow=! -d \ | |
15 | > --pid-file=hg.pid |
|
15 | > --pid-file=hg.pid | |
16 | $ cat hg.pid >> "$DAEMON_PIDS" |
|
16 | $ cat hg.pid >> "$DAEMON_PIDS" | |
17 | $ hg serve -a localhost -p $HGPORT2 -d --pid-file=hg.pid |
|
17 | $ hg serve -a localhost -p $HGPORT2 -d --pid-file=hg.pid | |
18 | $ cat hg.pid >> "$DAEMON_PIDS" |
|
18 | $ cat hg.pid >> "$DAEMON_PIDS" | |
19 |
|
19 | |||
20 | Verify that narrow is advertised in the bundle2 capabilities: |
|
20 | Verify that narrow is advertised in the bundle2 capabilities: | |
21 | $ echo hello | hg -R . serve --stdio | \ |
|
21 | $ echo hello | hg -R . serve --stdio | \ | |
22 |
> |
|
22 | > $PYTHON -c "import sys, urllib; print urllib.unquote_plus(list(sys.stdin)[1])" | grep narrow | |
23 | narrow=v0 |
|
23 | narrow=v0 | |
24 |
|
24 | |||
25 | $ cd .. |
|
25 | $ cd .. | |
26 |
|
26 | |||
27 | $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone |
|
27 | $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone | |
28 | requesting all changes |
|
28 | requesting all changes | |
29 | abort: server doesn't support narrow clones |
|
29 | abort: server doesn't support narrow clones | |
30 | [255] |
|
30 | [255] | |
31 |
|
31 | |||
32 | Make a narrow clone (via HGPORT2), then try to narrow and widen |
|
32 | Make a narrow clone (via HGPORT2), then try to narrow and widen | |
33 | into it (from HGPORT1) to prove that narrowing is fine and widening fails |
|
33 | into it (from HGPORT1) to prove that narrowing is fine and widening fails | |
34 | gracefully: |
|
34 | gracefully: | |
35 | $ hg clone -r 0 --narrow --include f1 http://localhost:$HGPORT2/ narrowclone |
|
35 | $ hg clone -r 0 --narrow --include f1 http://localhost:$HGPORT2/ narrowclone | |
36 | adding changesets |
|
36 | adding changesets | |
37 | adding manifests |
|
37 | adding manifests | |
38 | adding file changes |
|
38 | adding file changes | |
39 | added 1 changesets with 1 changes to 1 files |
|
39 | added 1 changesets with 1 changes to 1 files | |
40 | new changesets * (glob) |
|
40 | new changesets * (glob) | |
41 | updating to branch default |
|
41 | updating to branch default | |
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 | $ cd narrowclone |
|
43 | $ cd narrowclone | |
44 | $ hg tracked --addexclude f2 http://localhost:$HGPORT1/ |
|
44 | $ hg tracked --addexclude f2 http://localhost:$HGPORT1/ | |
45 | comparing with http://localhost:$HGPORT1/ |
|
45 | comparing with http://localhost:$HGPORT1/ | |
46 | searching for changes |
|
46 | searching for changes | |
47 | looking for local changes to affected paths |
|
47 | looking for local changes to affected paths | |
48 | $ hg tracked --addinclude f1 http://localhost:$HGPORT1/ |
|
48 | $ hg tracked --addinclude f1 http://localhost:$HGPORT1/ | |
49 | comparing with http://localhost:$HGPORT1/ |
|
49 | comparing with http://localhost:$HGPORT1/ | |
50 | searching for changes |
|
50 | searching for changes | |
51 | no changes found |
|
51 | no changes found | |
52 | abort: server doesn't support narrow clones |
|
52 | abort: server doesn't support narrow clones | |
53 | [255] |
|
53 | [255] |
@@ -1,72 +1,72 | |||||
1 | test sparse |
|
1 | test sparse | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH << EOF |
|
3 | $ cat >> $HGRCPATH << EOF | |
4 | > [ui] |
|
4 | > [ui] | |
5 |
> ssh = |
|
5 | > ssh = $PYTHON "$RUNTESTDIR/dummyssh" | |
6 | > username = nobody <no.reply@fb.com> |
|
6 | > username = nobody <no.reply@fb.com> | |
7 | > [extensions] |
|
7 | > [extensions] | |
8 | > sparse= |
|
8 | > sparse= | |
9 | > purge= |
|
9 | > purge= | |
10 | > strip= |
|
10 | > strip= | |
11 | > rebase= |
|
11 | > rebase= | |
12 | > EOF |
|
12 | > EOF | |
13 |
|
13 | |||
14 |
$ |
|
14 | $ hg init myrepo | |
15 | $ cd myrepo |
|
15 | $ cd myrepo | |
16 | $ echo a > index.html |
|
16 | $ echo a > index.html | |
17 | $ echo x > data.py |
|
17 | $ echo x > data.py | |
18 | $ echo z > readme.txt |
|
18 | $ echo z > readme.txt | |
19 | $ cat > webpage.sparse <<EOF |
|
19 | $ cat > webpage.sparse <<EOF | |
20 | > [include] |
|
20 | > [include] | |
21 | > *.html |
|
21 | > *.html | |
22 | > EOF |
|
22 | > EOF | |
23 | $ cat > backend.sparse <<EOF |
|
23 | $ cat > backend.sparse <<EOF | |
24 | > [include] |
|
24 | > [include] | |
25 | > *.py |
|
25 | > *.py | |
26 | > EOF |
|
26 | > EOF | |
27 | $ hg ci -Aqm 'initial' |
|
27 | $ hg ci -Aqm 'initial' | |
28 | $ cd .. |
|
28 | $ cd .. | |
29 |
|
29 | |||
30 | Verify local clone with a sparse profile works |
|
30 | Verify local clone with a sparse profile works | |
31 |
|
31 | |||
32 | $ hg clone --enable-profile webpage.sparse myrepo clone1 |
|
32 | $ hg clone --enable-profile webpage.sparse myrepo clone1 | |
33 | updating to branch default |
|
33 | updating to branch default | |
34 | warning: sparse profile 'webpage.sparse' not found in rev 000000000000 - ignoring it |
|
34 | warning: sparse profile 'webpage.sparse' not found in rev 000000000000 - ignoring it | |
35 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
35 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
36 | $ cd clone1 |
|
36 | $ cd clone1 | |
37 | $ ls |
|
37 | $ ls | |
38 | index.html |
|
38 | index.html | |
39 | $ cd .. |
|
39 | $ cd .. | |
40 |
|
40 | |||
41 | Verify local clone with include works |
|
41 | Verify local clone with include works | |
42 |
|
42 | |||
43 | $ hg clone --include *.sparse myrepo clone2 |
|
43 | $ hg clone --include *.sparse myrepo clone2 | |
44 | updating to branch default |
|
44 | updating to branch default | |
45 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
45 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
46 | $ cd clone2 |
|
46 | $ cd clone2 | |
47 | $ ls |
|
47 | $ ls | |
48 | backend.sparse |
|
48 | backend.sparse | |
49 | webpage.sparse |
|
49 | webpage.sparse | |
50 | $ cd .. |
|
50 | $ cd .. | |
51 |
|
51 | |||
52 | Verify local clone with exclude works |
|
52 | Verify local clone with exclude works | |
53 |
|
53 | |||
54 | $ hg clone --exclude data.py myrepo clone3 |
|
54 | $ hg clone --exclude data.py myrepo clone3 | |
55 | updating to branch default |
|
55 | updating to branch default | |
56 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
56 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
57 | $ cd clone3 |
|
57 | $ cd clone3 | |
58 | $ ls |
|
58 | $ ls | |
59 | backend.sparse |
|
59 | backend.sparse | |
60 | index.html |
|
60 | index.html | |
61 | readme.txt |
|
61 | readme.txt | |
62 | webpage.sparse |
|
62 | webpage.sparse | |
63 | $ cd .. |
|
63 | $ cd .. | |
64 |
|
64 | |||
65 | Verify sparse clone profile over ssh works |
|
65 | Verify sparse clone profile over ssh works | |
66 |
|
66 | |||
67 | $ hg clone -q --enable-profile webpage.sparse ssh://user@dummy/myrepo clone4 |
|
67 | $ hg clone -q --enable-profile webpage.sparse ssh://user@dummy/myrepo clone4 | |
68 | warning: sparse profile 'webpage.sparse' not found in rev 000000000000 - ignoring it |
|
68 | warning: sparse profile 'webpage.sparse' not found in rev 000000000000 - ignoring it | |
69 | $ cd clone4 |
|
69 | $ cd clone4 | |
70 | $ ls |
|
70 | $ ls | |
71 | index.html |
|
71 | index.html | |
72 | $ cd .. |
|
72 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now