Show More
@@ -1,124 +1,132 b'' | |||||
1 | #require no-reposimplestore |
|
1 | #require no-reposimplestore | |
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 | $ cat >> .hg/hgrc <<EOF |
|
7 | $ cat >> .hg/hgrc <<EOF | |
8 | > [narrow] |
|
8 | > [narrow] | |
9 | > serveellipses=True |
|
9 | > serveellipses=True | |
10 | > EOF |
|
10 | > EOF | |
11 | $ for x in `$TESTDIR/seq.py 10` |
|
11 | $ for x in `$TESTDIR/seq.py 10` | |
12 | > do |
|
12 | > do | |
13 | > echo $x > "f$x" |
|
13 | > echo $x > "f$x" | |
14 | > hg add "f$x" |
|
14 | > hg add "f$x" | |
15 | > done |
|
15 | > done | |
16 | $ hg commit -m "Add root files" |
|
16 | $ hg commit -m "Add root files" | |
17 | $ mkdir d1 d2 |
|
17 | $ mkdir d1 d2 | |
18 | $ for x in `$TESTDIR/seq.py 10` |
|
18 | $ for x in `$TESTDIR/seq.py 10` | |
19 | > do |
|
19 | > do | |
20 | > echo d1/$x > "d1/f$x" |
|
20 | > echo d1/$x > "d1/f$x" | |
21 | > hg add "d1/f$x" |
|
21 | > hg add "d1/f$x" | |
22 | > echo d2/$x > "d2/f$x" |
|
22 | > echo d2/$x > "d2/f$x" | |
23 | > hg add "d2/f$x" |
|
23 | > hg add "d2/f$x" | |
24 | > done |
|
24 | > done | |
25 | $ hg commit -m "Add d1 and d2" |
|
25 | $ hg commit -m "Add d1 and d2" | |
26 | $ for x in `$TESTDIR/seq.py 10` |
|
26 | $ for x in `$TESTDIR/seq.py 10` | |
27 | > do |
|
27 | > do | |
28 | > echo f$x rev2 > "f$x" |
|
28 | > echo f$x rev2 > "f$x" | |
29 | > echo d1/f$x rev2 > "d1/f$x" |
|
29 | > echo d1/f$x rev2 > "d1/f$x" | |
30 | > echo d2/f$x rev2 > "d2/f$x" |
|
30 | > echo d2/f$x rev2 > "d2/f$x" | |
31 | > hg commit -m "Commit rev2 of f$x, d1/f$x, d2/f$x" |
|
31 | > hg commit -m "Commit rev2 of f$x, d1/f$x, d2/f$x" | |
32 | > done |
|
32 | > done | |
33 | $ cd .. |
|
33 | $ cd .. | |
34 |
|
34 | |||
35 | narrow and shallow clone the d2 directory |
|
35 | narrow and shallow clone the d2 directory | |
36 |
|
36 | |||
37 | $ hg clone --narrow ssh://user@dummy/master shallow --include "d2" --depth 2 |
|
37 | $ hg clone --narrow ssh://user@dummy/master shallow --include "d2" --depth 2 | |
38 | requesting all changes |
|
38 | requesting all changes | |
39 | adding changesets |
|
39 | adding changesets | |
40 | adding manifests |
|
40 | adding manifests | |
41 | adding file changes |
|
41 | adding file changes | |
42 | added 4 changesets with 13 changes to 10 files |
|
42 | added 4 changesets with 13 changes to 10 files | |
43 | new changesets *:* (glob) |
|
43 | new changesets *:* (glob) | |
44 | updating to branch default |
|
44 | updating to branch default | |
45 | 10 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
45 | 10 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
46 | $ cd shallow |
|
46 | $ cd shallow | |
47 | $ hg log -T '{rev}{if(ellipsis,"...")}: {desc}\n' |
|
47 | $ hg log -T '{rev}{if(ellipsis,"...")}: {desc}\n' | |
48 | 3: Commit rev2 of f10, d1/f10, d2/f10 |
|
48 | 3: Commit rev2 of f10, d1/f10, d2/f10 | |
49 | 2: Commit rev2 of f9, d1/f9, d2/f9 |
|
49 | 2: Commit rev2 of f9, d1/f9, d2/f9 | |
50 | 1: Commit rev2 of f8, d1/f8, d2/f8 |
|
50 | 1: Commit rev2 of f8, d1/f8, d2/f8 | |
51 | 0...: Commit rev2 of f7, d1/f7, d2/f7 |
|
51 | 0...: Commit rev2 of f7, d1/f7, d2/f7 | |
52 | $ hg update 0 |
|
52 | $ hg update 0 | |
53 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
53 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
54 | $ cat d2/f7 d2/f8 |
|
54 | $ cat d2/f7 d2/f8 | |
55 | d2/f7 rev2 |
|
55 | d2/f7 rev2 | |
56 | d2/8 |
|
56 | d2/8 | |
57 |
|
57 | |||
58 | $ cd .. |
|
58 | $ cd .. | |
59 |
|
59 | |||
60 | change every upstream file once |
|
60 | change every upstream file once | |
61 |
|
61 | |||
62 | $ cd master |
|
62 | $ cd master | |
63 | $ for x in `$TESTDIR/seq.py 10` |
|
63 | $ for x in `$TESTDIR/seq.py 10` | |
64 | > do |
|
64 | > do | |
65 | > echo f$x rev3 > "f$x" |
|
65 | > echo f$x rev3 > "f$x" | |
66 | > echo d1/f$x rev3 > "d1/f$x" |
|
66 | > echo d1/f$x rev3 > "d1/f$x" | |
67 | > echo d2/f$x rev3 > "d2/f$x" |
|
67 | > echo d2/f$x rev3 > "d2/f$x" | |
68 | > hg commit -m "Commit rev3 of f$x, d1/f$x, d2/f$x" |
|
68 | > hg commit -m "Commit rev3 of f$x, d1/f$x, d2/f$x" | |
69 | > done |
|
69 | > done | |
70 | $ cd .. |
|
70 | $ cd .. | |
71 |
|
71 | |||
72 | pull new changes with --depth specified. There were 10 changes to the d2 |
|
72 | pull new changes with --depth specified. There were 10 changes to the d2 | |
73 | directory but the shallow pull should only fetch 3. |
|
73 | directory but the shallow pull should only fetch 3. | |
74 |
|
74 | |||
75 | $ cd shallow |
|
75 | $ cd shallow | |
76 | $ hg pull --depth 2 |
|
76 | $ hg pull --depth 2 | |
77 | pulling from ssh://user@dummy/master |
|
77 | pulling from ssh://user@dummy/master | |
78 | searching for changes |
|
78 | searching for changes | |
79 | adding changesets |
|
79 | adding changesets | |
80 | adding manifests |
|
80 | adding manifests | |
81 | adding file changes |
|
81 | adding file changes | |
82 | added 4 changesets with 10 changes to 10 files |
|
82 | added 4 changesets with 10 changes to 10 files | |
83 | new changesets *:* (glob) |
|
83 | new changesets *:* (glob) | |
84 | (run 'hg update' to get a working copy) |
|
84 | (run 'hg update' to get a working copy) | |
85 | $ hg log -T '{rev}{if(ellipsis,"...")}: {desc}\n' |
|
85 | $ hg log -T '{rev}{if(ellipsis,"...")}: {desc}\n' | |
86 | 7: Commit rev3 of f10, d1/f10, d2/f10 |
|
86 | 7: Commit rev3 of f10, d1/f10, d2/f10 | |
87 | 6: Commit rev3 of f9, d1/f9, d2/f9 |
|
87 | 6: Commit rev3 of f9, d1/f9, d2/f9 | |
88 | 5: Commit rev3 of f8, d1/f8, d2/f8 |
|
88 | 5: Commit rev3 of f8, d1/f8, d2/f8 | |
89 | 4...: Commit rev3 of f7, d1/f7, d2/f7 |
|
89 | 4...: Commit rev3 of f7, d1/f7, d2/f7 | |
90 | 3: Commit rev2 of f10, d1/f10, d2/f10 |
|
90 | 3: Commit rev2 of f10, d1/f10, d2/f10 | |
91 | 2: Commit rev2 of f9, d1/f9, d2/f9 |
|
91 | 2: Commit rev2 of f9, d1/f9, d2/f9 | |
92 | 1: Commit rev2 of f8, d1/f8, d2/f8 |
|
92 | 1: Commit rev2 of f8, d1/f8, d2/f8 | |
93 | 0...: Commit rev2 of f7, d1/f7, d2/f7 |
|
93 | 0...: Commit rev2 of f7, d1/f7, d2/f7 | |
|
94 | ||||
|
95 | XXX flaky output (see issue6150) | |||
|
96 | XXX | |||
|
97 | XXX The filectx implementation is buggy and return wrong data during status. | |||
|
98 | XXX Leading to more file being "merged". The right output is the one with just | |||
|
99 | XXX 10 files updated. | |||
|
100 | ||||
94 | $ hg update 4 |
|
101 | $ hg update 4 | |
95 | merging d2/f1 |
|
102 | merging d2/f1 (?) | |
96 |
|
|
103 | merging d2/f2 (?) | |
97 |
|
|
104 | merging d2/f3 (?) | |
98 |
|
|
105 | merging d2/f4 (?) | |
99 |
|
|
106 | merging d2/f5 (?) | |
100 |
|
|
107 | merging d2/f6 (?) | |
101 |
|
|
108 | merging d2/f7 (?) | |
102 |
|
|
109 | 3 files updated, 7 files merged, 0 files removed, 0 files unresolved (?) | |
|
110 | 10 files updated, 0 files merged, 0 files removed, 0 files unresolved (?) | |||
103 | $ cat d2/f7 d2/f8 |
|
111 | $ cat d2/f7 d2/f8 | |
104 | d2/f7 rev3 |
|
112 | d2/f7 rev3 | |
105 | d2/f8 rev2 |
|
113 | d2/f8 rev2 | |
106 | $ hg update 7 |
|
114 | $ hg update 7 | |
107 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
115 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
108 | $ cat d2/f10 |
|
116 | $ cat d2/f10 | |
109 | d2/f10 rev3 |
|
117 | d2/f10 rev3 | |
110 |
|
118 | |||
111 | $ cd .. |
|
119 | $ cd .. | |
112 |
|
120 | |||
113 | cannot clone with zero or negative depth |
|
121 | cannot clone with zero or negative depth | |
114 |
|
122 | |||
115 | $ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth 0 |
|
123 | $ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth 0 | |
116 | requesting all changes |
|
124 | requesting all changes | |
117 | remote: abort: depth must be positive, got 0 |
|
125 | remote: abort: depth must be positive, got 0 | |
118 | abort: pull failed on remote |
|
126 | abort: pull failed on remote | |
119 | [255] |
|
127 | [255] | |
120 | $ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth -1 |
|
128 | $ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth -1 | |
121 | requesting all changes |
|
129 | requesting all changes | |
122 | remote: abort: depth must be positive, got -1 |
|
130 | remote: abort: depth must be positive, got -1 | |
123 | abort: pull failed on remote |
|
131 | abort: pull failed on remote | |
124 | [255] |
|
132 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now