Show More
@@ -0,0 +1,132 b'' | |||
|
1 | #testcases flat tree | |
|
2 | ||
|
3 | $ . "$TESTDIR/narrow-library.sh" | |
|
4 | ||
|
5 | #if tree | |
|
6 | $ cat << EOF >> $HGRCPATH | |
|
7 | > [experimental] | |
|
8 | > treemanifest = 1 | |
|
9 | > EOF | |
|
10 | #endif | |
|
11 | ||
|
12 | $ cat << EOF >> $HGRCPATH | |
|
13 | > [extensions] | |
|
14 | > share = | |
|
15 | > EOF | |
|
16 | ||
|
17 | $ hg init remote | |
|
18 | $ cd remote | |
|
19 | $ for x in `$TESTDIR/seq.py 0 10` | |
|
20 | > do | |
|
21 | > mkdir d$x | |
|
22 | > echo $x > d$x/f | |
|
23 | > hg add d$x/f | |
|
24 | > hg commit -m "add d$x/f" | |
|
25 | > done | |
|
26 | $ cd .. | |
|
27 | ||
|
28 | $ hg clone --narrow ssh://user@dummy/remote main -q \ | |
|
29 | > --include d1 --include d3 --include d5 --include d7 | |
|
30 | ||
|
31 | $ hg share main share | |
|
32 | updating working directory | |
|
33 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
34 | $ hg -R share tracked | |
|
35 | I path:d1 | |
|
36 | I path:d3 | |
|
37 | I path:d5 | |
|
38 | I path:d7 | |
|
39 | $ hg -R share files | |
|
40 | share/d1/f | |
|
41 | share/d3/f | |
|
42 | share/d5/f | |
|
43 | share/d7/f | |
|
44 | ||
|
45 | Narrow the share and check that the main repo's working copy gets updated | |
|
46 | ||
|
47 | # Make d3/f dirty | |
|
48 | $ echo x >> main/d3/f | |
|
49 | $ echo y >> main/d3/g | |
|
50 | $ hg add main/d3/g | |
|
51 | $ hg -R main st | |
|
52 | M d3/f | |
|
53 | A d3/g | |
|
54 | # Make d5/f not match the dirstate timestamp even though it's clean | |
|
55 | $ sleep 2 | |
|
56 | $ hg -R main st | |
|
57 | M d3/f | |
|
58 | A d3/g | |
|
59 | $ hg -R main debugdirstate --no-dates | |
|
60 | n 644 2 set d1/f | |
|
61 | n 644 2 unset d3/f | |
|
62 | a 0 -1 unset d3/g | |
|
63 | n 644 2 set d5/f | |
|
64 | n 644 2 set d7/f | |
|
65 | $ touch main/d5/f | |
|
66 | $ hg -R share tracked --removeinclude d1 --removeinclude d3 --removeinclude d5 | |
|
67 | comparing with ssh://user@dummy/remote | |
|
68 | searching for changes | |
|
69 | looking for local changes to affected paths | |
|
70 | deleting data/d1/f.i | |
|
71 | deleting data/d3/f.i | |
|
72 | deleting data/d5/f.i | |
|
73 | deleting meta/d1/00manifest.i (tree !) | |
|
74 | deleting meta/d3/00manifest.i (tree !) | |
|
75 | deleting meta/d5/00manifest.i (tree !) | |
|
76 | $ hg -R main tracked | |
|
77 | I path:d7 | |
|
78 | # d1/f, d3/f, d3/g and d5/f should no longer be reported | |
|
79 | $ hg -R main files | |
|
80 | main/d7/f | |
|
81 | # d1/f should no longer be there, d3/f should be since it was dirty, d3/g should be there since | |
|
82 | # it was added, and d5/f should be since we couldn't be sure it was clean | |
|
83 | $ find main/d* -type f | sort | |
|
84 | main/d1/f | |
|
85 | main/d3/f | |
|
86 | main/d3/g | |
|
87 | main/d5/f | |
|
88 | main/d7/f | |
|
89 | ||
|
90 | Widen the share and check that the main repo's working copy gets updated | |
|
91 | ||
|
92 | $ hg -R share tracked --addinclude d1 --addinclude d3 -q | |
|
93 | $ hg -R share tracked | |
|
94 | I path:d1 | |
|
95 | I path:d3 | |
|
96 | I path:d7 | |
|
97 | $ hg -R share files | |
|
98 | share/d1/f | |
|
99 | share/d3/f | |
|
100 | share/d7/f | |
|
101 | $ hg -R main tracked | |
|
102 | I path:d1 | |
|
103 | I path:d3 | |
|
104 | I path:d7 | |
|
105 | # d1/f, d3/f should be back | |
|
106 | $ hg -R main files | |
|
107 | main/d1/f | |
|
108 | main/d3/f | |
|
109 | main/d3/g | |
|
110 | main/d7/f | |
|
111 | # d3/f should be modified (not clobbered by the widening), and d3/g should be untracked | |
|
112 | $ hg -R main st --all | |
|
113 | M d3/f | |
|
114 | A d3/g | |
|
115 | C d1/f | |
|
116 | C d7/f | |
|
117 | ||
|
118 | We should also be able to unshare without breaking everything: | |
|
119 | ||
|
120 | $ hg share main share-unshare | |
|
121 | updating working directory | |
|
122 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
123 | $ cd share-unshare | |
|
124 | $ hg unshare | |
|
125 | $ hg verify | |
|
126 | checking changesets | |
|
127 | checking manifests | |
|
128 | checking directory manifests (tree !) | |
|
129 | crosschecking files in changesets and manifests | |
|
130 | checking files | |
|
131 | checked 11 changesets with 3 changes to 3 files | |
|
132 | $ cd .. |
@@ -1,174 +1,152 b'' | |||
|
1 | 1 | $ . "$TESTDIR/narrow-library.sh" |
|
2 | 2 | |
|
3 | 3 | $ hg init master |
|
4 | 4 | $ cd master |
|
5 | 5 | $ cat >> .hg/hgrc <<EOF |
|
6 | 6 | > [narrow] |
|
7 | 7 | > serveellipses=True |
|
8 | 8 | > EOF |
|
9 | 9 | $ for x in `$TESTDIR/seq.py 10` |
|
10 | 10 | > do |
|
11 | 11 | > echo $x > "f$x" |
|
12 | 12 | > hg add "f$x" |
|
13 | 13 | > hg commit -m "Commit f$x" |
|
14 | 14 | > done |
|
15 | 15 | $ cd .. |
|
16 | 16 | |
|
17 | 17 | narrow clone a couple files, f2 and f8 |
|
18 | 18 | |
|
19 | 19 | $ hg clone --narrow ssh://user@dummy/master narrow --include "f2" --include "f8" |
|
20 | 20 | requesting all changes |
|
21 | 21 | adding changesets |
|
22 | 22 | adding manifests |
|
23 | 23 | adding file changes |
|
24 | 24 | added 5 changesets with 2 changes to 2 files |
|
25 | 25 | new changesets *:* (glob) |
|
26 | 26 | updating to branch default |
|
27 | 27 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
28 | 28 | $ cd narrow |
|
29 | 29 | $ ls |
|
30 | 30 | f2 |
|
31 | 31 | f8 |
|
32 | 32 | $ cat f2 f8 |
|
33 | 33 | 2 |
|
34 | 34 | 8 |
|
35 | 35 | |
|
36 | 36 | $ cd .. |
|
37 | 37 | |
|
38 | 38 | change every upstream file twice |
|
39 | 39 | |
|
40 | 40 | $ cd master |
|
41 | 41 | $ for x in `$TESTDIR/seq.py 10` |
|
42 | 42 | > do |
|
43 | 43 | > echo "update#1 $x" >> "f$x" |
|
44 | 44 | > hg commit -m "Update#1 to f$x" "f$x" |
|
45 | 45 | > done |
|
46 | 46 | $ for x in `$TESTDIR/seq.py 10` |
|
47 | 47 | > do |
|
48 | 48 | > echo "update#2 $x" >> "f$x" |
|
49 | 49 | > hg commit -m "Update#2 to f$x" "f$x" |
|
50 | 50 | > done |
|
51 | 51 | $ cd .. |
|
52 | 52 | |
|
53 | 53 | look for incoming changes |
|
54 | 54 | |
|
55 | 55 | $ cd narrow |
|
56 | 56 | $ hg incoming --limit 3 |
|
57 | 57 | comparing with ssh://user@dummy/master |
|
58 | 58 | searching for changes |
|
59 | 59 | changeset: 5:ddc055582556 |
|
60 | 60 | user: test |
|
61 | 61 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
62 | 62 | summary: Update#1 to f1 |
|
63 | 63 | |
|
64 | 64 | changeset: 6:f66eb5ad621d |
|
65 | 65 | user: test |
|
66 | 66 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
67 | 67 | summary: Update#1 to f2 |
|
68 | 68 | |
|
69 | 69 | changeset: 7:c42ecff04e99 |
|
70 | 70 | user: test |
|
71 | 71 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
72 | 72 | summary: Update#1 to f3 |
|
73 | 73 | |
|
74 | 74 | |
|
75 | 75 | Interrupting the pull is safe |
|
76 | 76 | $ hg --config hooks.pretxnchangegroup.bad=false pull -q |
|
77 | 77 | transaction abort! |
|
78 | 78 | rollback completed |
|
79 | 79 | abort: pretxnchangegroup.bad hook exited with status 1 |
|
80 | 80 | [255] |
|
81 | 81 | $ hg id |
|
82 | 82 | 223311e70a6f tip |
|
83 | 83 | |
|
84 | 84 | pull new changes down to the narrow clone. Should get 8 new changesets: 4 |
|
85 | 85 | relevant to the narrow spec, and 4 ellipsis nodes gluing them all together. |
|
86 | 86 | |
|
87 | 87 | $ hg pull |
|
88 | 88 | pulling from ssh://user@dummy/master |
|
89 | 89 | searching for changes |
|
90 | 90 | adding changesets |
|
91 | 91 | adding manifests |
|
92 | 92 | adding file changes |
|
93 | 93 | added 9 changesets with 4 changes to 2 files |
|
94 | 94 | new changesets *:* (glob) |
|
95 | 95 | (run 'hg update' to get a working copy) |
|
96 | 96 | $ hg log -T '{rev}: {desc}\n' |
|
97 | 97 | 13: Update#2 to f10 |
|
98 | 98 | 12: Update#2 to f8 |
|
99 | 99 | 11: Update#2 to f7 |
|
100 | 100 | 10: Update#2 to f2 |
|
101 | 101 | 9: Update#2 to f1 |
|
102 | 102 | 8: Update#1 to f8 |
|
103 | 103 | 7: Update#1 to f7 |
|
104 | 104 | 6: Update#1 to f2 |
|
105 | 105 | 5: Update#1 to f1 |
|
106 | 106 | 4: Commit f10 |
|
107 | 107 | 3: Commit f8 |
|
108 | 108 | 2: Commit f7 |
|
109 | 109 | 1: Commit f2 |
|
110 | 110 | 0: Commit f1 |
|
111 | 111 | $ hg update tip |
|
112 | 112 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
113 | 113 | |
|
114 | 114 | add a change and push it |
|
115 | 115 | |
|
116 | 116 | $ echo "update#3 2" >> f2 |
|
117 | 117 | $ hg commit -m "Update#3 to f2" f2 |
|
118 | 118 | $ hg log f2 -T '{rev}: {desc}\n' |
|
119 | 119 | 14: Update#3 to f2 |
|
120 | 120 | 10: Update#2 to f2 |
|
121 | 121 | 6: Update#1 to f2 |
|
122 | 122 | 1: Commit f2 |
|
123 | 123 | $ hg push |
|
124 | 124 | pushing to ssh://user@dummy/master |
|
125 | 125 | searching for changes |
|
126 | 126 | remote: adding changesets |
|
127 | 127 | remote: adding manifests |
|
128 | 128 | remote: adding file changes |
|
129 | 129 | remote: added 1 changesets with 1 changes to 1 files |
|
130 | 130 | $ cd .. |
|
131 | 131 | |
|
132 | 132 | $ cd master |
|
133 | 133 | $ hg log f2 -T '{rev}: {desc}\n' |
|
134 | 134 | 30: Update#3 to f2 |
|
135 | 135 | 21: Update#2 to f2 |
|
136 | 136 | 11: Update#1 to f2 |
|
137 | 137 | 1: Commit f2 |
|
138 | 138 | $ hg log -l 3 -T '{rev}: {desc}\n' |
|
139 | 139 | 30: Update#3 to f2 |
|
140 | 140 | 29: Update#2 to f10 |
|
141 | 141 | 28: Update#2 to f9 |
|
142 | 142 | |
|
143 | 143 | Can pull into repo with a single commit |
|
144 | 144 | |
|
145 | 145 | $ cd .. |
|
146 | 146 | $ hg clone -q --narrow ssh://user@dummy/master narrow2 --include "f1" -r 0 |
|
147 | 147 | $ cd narrow2 |
|
148 | 148 | $ hg pull -q -r 1 |
|
149 | 149 | transaction abort! |
|
150 | 150 | rollback completed |
|
151 | 151 | abort: pull failed on remote |
|
152 | 152 | [255] |
|
153 | ||
|
154 | Can use 'hg share': | |
|
155 | $ cat >> $HGRCPATH <<EOF | |
|
156 | > [extensions] | |
|
157 | > share= | |
|
158 | > EOF | |
|
159 | ||
|
160 | $ cd .. | |
|
161 | $ hg share narrow2 narrow2-share | |
|
162 | updating working directory | |
|
163 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
164 | $ cd narrow2-share | |
|
165 | $ hg status | |
|
166 | ||
|
167 | We should also be able to unshare without breaking everything: | |
|
168 | $ hg unshare | |
|
169 | $ hg verify | |
|
170 | checking changesets | |
|
171 | checking manifests | |
|
172 | crosschecking files in changesets and manifests | |
|
173 | checking files | |
|
174 | checked 1 changesets with 1 changes to 1 files |
General Comments 0
You need to be logged in to leave comments.
Login now