Show More
@@ -1,53 +1,65 | |||||
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 | ||||
|
22 | $ cat >> unquote.py <<EOF | |||
|
23 | > from __future__ import print_function | |||
|
24 | > import sys | |||
|
25 | > if sys.version[0] == '3': | |||
|
26 | > import urllib.parse as up | |||
|
27 | > unquote = up.unquote_plus | |||
|
28 | > else: | |||
|
29 | > import urllib | |||
|
30 | > unquote = urllib.unquote_plus | |||
|
31 | > print(unquote(list(sys.stdin)[1])) | |||
|
32 | > EOF | |||
21 | $ echo hello | hg -R . serve --stdio | \ |
|
33 | $ echo hello | hg -R . serve --stdio | \ | |
22 | > $PYTHON -c "from __future__ import print_function; import sys, urllib; print(urllib.unquote_plus(list(sys.stdin)[1]))" | grep narrow |
|
34 | > $PYTHON unquote.py | grep narrow | |
23 | narrow=v0 |
|
35 | narrow=v0 | |
24 |
|
36 | |||
25 | $ cd .. |
|
37 | $ cd .. | |
26 |
|
38 | |||
27 | $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone |
|
39 | $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone | |
28 | requesting all changes |
|
40 | requesting all changes | |
29 | abort: server doesn't support narrow clones |
|
41 | abort: server doesn't support narrow clones | |
30 | [255] |
|
42 | [255] | |
31 |
|
43 | |||
32 | Make a narrow clone (via HGPORT2), then try to narrow and widen |
|
44 | 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 |
|
45 | into it (from HGPORT1) to prove that narrowing is fine and widening fails | |
34 | gracefully: |
|
46 | gracefully: | |
35 | $ hg clone -r 0 --narrow --include f1 http://localhost:$HGPORT2/ narrowclone |
|
47 | $ hg clone -r 0 --narrow --include f1 http://localhost:$HGPORT2/ narrowclone | |
36 | adding changesets |
|
48 | adding changesets | |
37 | adding manifests |
|
49 | adding manifests | |
38 | adding file changes |
|
50 | adding file changes | |
39 | added 1 changesets with 1 changes to 1 files |
|
51 | added 1 changesets with 1 changes to 1 files | |
40 | new changesets * (glob) |
|
52 | new changesets * (glob) | |
41 | updating to branch default |
|
53 | updating to branch default | |
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
54 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 | $ cd narrowclone |
|
55 | $ cd narrowclone | |
44 | $ hg tracked --addexclude f2 http://localhost:$HGPORT1/ |
|
56 | $ hg tracked --addexclude f2 http://localhost:$HGPORT1/ | |
45 | comparing with http://localhost:$HGPORT1/ |
|
57 | comparing with http://localhost:$HGPORT1/ | |
46 | searching for changes |
|
58 | searching for changes | |
47 | looking for local changes to affected paths |
|
59 | looking for local changes to affected paths | |
48 | $ hg tracked --addinclude f1 http://localhost:$HGPORT1/ |
|
60 | $ hg tracked --addinclude f1 http://localhost:$HGPORT1/ | |
49 | comparing with http://localhost:$HGPORT1/ |
|
61 | comparing with http://localhost:$HGPORT1/ | |
50 | searching for changes |
|
62 | searching for changes | |
51 | no changes found |
|
63 | no changes found | |
52 |
|
|
64 | abort: server doesn't support narrow clones | |
53 | [255] |
|
65 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now