Show More
@@ -1,53 +1,65 | |||
|
1 | 1 | Test attempting a narrow clone against a server that doesn't support narrowhg. |
|
2 | 2 | |
|
3 | 3 | $ . "$TESTDIR/narrow-library.sh" |
|
4 | 4 | |
|
5 | 5 | $ hg init master |
|
6 | 6 | $ cd master |
|
7 | 7 | |
|
8 | 8 | $ for x in `$TESTDIR/seq.py 10`; do |
|
9 | 9 | > echo $x > "f$x" |
|
10 | 10 | > hg add "f$x" |
|
11 | 11 | > hg commit -m "Add $x" |
|
12 | 12 | > done |
|
13 | 13 | |
|
14 | 14 | $ hg serve -a localhost -p $HGPORT1 --config extensions.narrow=! -d \ |
|
15 | 15 | > --pid-file=hg.pid |
|
16 | 16 | $ cat hg.pid >> "$DAEMON_PIDS" |
|
17 | 17 | $ hg serve -a localhost -p $HGPORT2 -d --pid-file=hg.pid |
|
18 | 18 | $ cat hg.pid >> "$DAEMON_PIDS" |
|
19 | 19 | |
|
20 | 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 | 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 | 35 | narrow=v0 |
|
24 | 36 | |
|
25 | 37 | $ cd .. |
|
26 | 38 | |
|
27 | 39 | $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone |
|
28 | 40 | requesting all changes |
|
29 | 41 | abort: server doesn't support narrow clones |
|
30 | 42 | [255] |
|
31 | 43 | |
|
32 | 44 | Make a narrow clone (via HGPORT2), then try to narrow and widen |
|
33 | 45 | into it (from HGPORT1) to prove that narrowing is fine and widening fails |
|
34 | 46 | gracefully: |
|
35 | 47 | $ hg clone -r 0 --narrow --include f1 http://localhost:$HGPORT2/ narrowclone |
|
36 | 48 | adding changesets |
|
37 | 49 | adding manifests |
|
38 | 50 | adding file changes |
|
39 | 51 | added 1 changesets with 1 changes to 1 files |
|
40 | 52 | new changesets * (glob) |
|
41 | 53 | updating to branch default |
|
42 | 54 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
43 | 55 | $ cd narrowclone |
|
44 | 56 | $ hg tracked --addexclude f2 http://localhost:$HGPORT1/ |
|
45 | 57 | comparing with http://localhost:$HGPORT1/ |
|
46 | 58 | searching for changes |
|
47 | 59 | looking for local changes to affected paths |
|
48 | 60 | $ hg tracked --addinclude f1 http://localhost:$HGPORT1/ |
|
49 | 61 | comparing with http://localhost:$HGPORT1/ |
|
50 | 62 | searching for changes |
|
51 | 63 | no changes found |
|
52 | 64 |
|
|
53 | 65 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now