Show More
This diff has been collapsed as it changes many lines, (573 lines changed) Show them Hide them | |||||
@@ -1,216 +1,417 | |||||
1 | #!/bin/sh |
|
1 | adjust to non-default HGPORT, e.g. with run-tests.py -j | |
2 |
|
2 | |||
3 | # adjust to non-default HGPORT, e.g. with run-tests.py -j |
|
3 | $ echo "[extensions]" >> $HGRCPATH | |
4 | hideport() { sed "s/localhost:$HGPORT/localhost:\$HGPORT/"; } |
|
4 | $ echo "fetch=" >> $HGRCPATH | |
5 | hidehash() { sed "s/changeset 3:............ merges/changeset 3:... merges/"; } |
|
|||
6 |
|
5 | |||
7 | echo "[extensions]" >> $HGRCPATH |
|
6 | test fetch with default branches only | |
8 | echo "fetch=" >> $HGRCPATH |
|
|||
9 |
|
7 | |||
10 | echo % test fetch with default branches only |
|
8 | $ hg init a | |
11 | hg init a |
|
9 | $ echo a > a/a | |
12 | echo a > a/a |
|
10 | $ hg --cwd a commit -d '1 0' -Ama | |
13 | hg --cwd a commit -d '1 0' -Ama |
|
11 | adding a | |
|
12 | $ hg clone a b | |||
|
13 | updating to branch default | |||
|
14 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
15 | $ hg clone a c | |||
|
16 | updating to branch default | |||
|
17 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
18 | $ echo b > a/b | |||
|
19 | $ hg --cwd a commit -d '2 0' -Amb | |||
|
20 | adding b | |||
|
21 | $ hg --cwd a parents -q | |||
|
22 | 1:97d72e5f12c7 | |||
14 |
|
23 | |||
15 | hg clone a b |
|
24 | should pull one change | |
16 | hg clone a c |
|
|||
17 |
|
25 | |||
18 | echo b > a/b |
|
26 | $ hg --cwd b fetch ../a | |
19 | hg --cwd a commit -d '2 0' -Amb |
|
27 | pulling from ../a | |
20 | hg --cwd a parents -q |
|
28 | searching for changes | |
21 |
|
29 | adding changesets | ||
22 | echo % should pull one change |
|
30 | adding manifests | |
23 | hg --cwd b fetch ../a |
|
31 | adding file changes | |
24 | hg --cwd b parents -q |
|
32 | added 1 changesets with 1 changes to 1 files | |
|
33 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
34 | $ hg --cwd b parents -q | |||
|
35 | 1:97d72e5f12c7 | |||
|
36 | $ echo c > c/c | |||
|
37 | $ hg --cwd c commit -d '3 0' -Amc | |||
|
38 | adding c | |||
|
39 | $ hg clone c d | |||
|
40 | updating to branch default | |||
|
41 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
42 | $ hg clone c e | |||
|
43 | updating to branch default | |||
|
44 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
25 |
|
45 | |||
26 | echo c > c/c |
|
46 | We cannot use the default commit message if fetching from a local | |
27 | hg --cwd c commit -d '3 0' -Amc |
|
47 | repo, because the path of the repo will be included in the commit | |
28 |
|
48 | message, making every commit appear different. | ||
29 | hg clone c d |
|
49 | should merge c into a | |
30 | hg clone c e |
|
|||
31 |
|
||||
32 | # We cannot use the default commit message if fetching from a local |
|
|||
33 | # repo, because the path of the repo will be included in the commit |
|
|||
34 | # message, making every commit appear different. |
|
|||
35 |
|
||||
36 | echo % should merge c into a |
|
|||
37 | hg --cwd c fetch -d '4 0' -m 'automated merge' ../a |
|
|||
38 | ls c |
|
|||
39 |
|
50 | |||
40 | netstat -tnap 2>/dev/null | grep $HGPORT | grep LISTEN |
|
51 | $ hg --cwd c fetch -d '4 0' -m 'automated merge' ../a | |
41 | hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid |
|
52 | pulling from ../a | |
42 | cat a/hg.pid >> "$DAEMON_PIDS" |
|
53 | searching for changes | |
|
54 | adding changesets | |||
|
55 | adding manifests | |||
|
56 | adding file changes | |||
|
57 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
58 | updating to 2:97d72e5f12c7 | |||
|
59 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
60 | merging with 1:5e056962225c | |||
|
61 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
62 | new changeset 3:cd3a41621cf0 merges remote changes with local | |||
|
63 | $ ls c | |||
|
64 | a | |||
|
65 | b | |||
|
66 | c | |||
|
67 | $ netstat -tnap 2>/dev/null | grep $HGPORT | grep LISTEN | |||
|
68 | [1] | |||
|
69 | $ hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid | |||
|
70 | $ cat a/hg.pid >> "$DAEMON_PIDS" | |||
43 |
|
71 | |||
44 |
|
|
72 | fetch over http, no auth | |
45 | hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/ | hideport | hidehash |
|
|||
46 | hg --cwd d tip --template '{desc}\n' | hideport |
|
|||
47 |
|
73 | |||
48 | echo '% fetch over http with auth (should be hidden in desc)' |
|
74 | $ hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/ | |
49 | hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/ | hideport | hidehash |
|
75 | pulling from http://localhost:*/ (glob) | |
50 | hg --cwd e tip --template '{desc}\n' | hideport |
|
76 | searching for changes | |
|
77 | adding changesets | |||
|
78 | adding manifests | |||
|
79 | adding file changes | |||
|
80 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
81 | updating to 2:97d72e5f12c7 | |||
|
82 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
83 | merging with 1:5e056962225c | |||
|
84 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
85 | new changeset 3:0b6439e938f9 merges remote changes with local | |||
|
86 | $ hg --cwd d tip --template '{desc}\n' | |||
|
87 | Automated merge with http://localhost:*/ (glob) | |||
51 |
|
88 | |||
52 | hg clone a f |
|
89 | fetch over http with auth (should be hidden in desc) | |
53 | hg clone a g |
|
|||
54 |
|
90 | |||
55 | echo f > f/f |
|
91 | $ hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/ | |
56 | hg --cwd f ci -d '6 0' -Amf |
|
92 | pulling from http://user:***@localhost:*/ (glob) | |
57 |
|
93 | searching for changes | ||
58 | echo g > g/g |
|
94 | adding changesets | |
59 | hg --cwd g ci -d '6 0' -Amg |
|
95 | adding manifests | |
|
96 | adding file changes | |||
|
97 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
98 | updating to 2:97d72e5f12c7 | |||
|
99 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
100 | merging with 1:5e056962225c | |||
|
101 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
102 | new changeset 3:0b6439e938f9 merges remote changes with local | |||
|
103 | $ hg --cwd e tip --template '{desc}\n' | |||
|
104 | Automated merge with http://localhost:*/ (glob) | |||
|
105 | $ hg clone a f | |||
|
106 | updating to branch default | |||
|
107 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
108 | $ hg clone a g | |||
|
109 | updating to branch default | |||
|
110 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
111 | $ echo f > f/f | |||
|
112 | $ hg --cwd f ci -d '6 0' -Amf | |||
|
113 | adding f | |||
|
114 | $ echo g > g/g | |||
|
115 | $ hg --cwd g ci -d '6 0' -Amg | |||
|
116 | adding g | |||
|
117 | $ hg clone -q f h | |||
|
118 | $ hg clone -q g i | |||
60 |
|
119 | |||
61 | hg clone -q f h |
|
120 | should merge f into g | |
62 | hg clone -q g i |
|
|||
63 |
|
121 | |||
64 | echo % should merge f into g |
|
122 | $ hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f | |
65 | hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f |
|
123 | pulling from ../f | |
|
124 | searching for changes | |||
|
125 | adding changesets | |||
|
126 | adding manifests | |||
|
127 | adding file changes | |||
|
128 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
129 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
130 | merging with 3:cc6a3744834d | |||
|
131 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
132 | new changeset 4:55aa4f32ec59 merges remote changes with local | |||
|
133 | $ rm i/g | |||
66 |
|
134 | |||
67 | rm i/g |
|
135 | should abort, because i is modified | |
68 | echo % should abort, because i is modified |
|
|||
69 | hg --cwd i fetch ../h |
|
|||
70 |
|
136 | |||
|
137 | $ hg --cwd i fetch ../h | |||
|
138 | abort: working directory is missing some files | |||
|
139 | [255] | |||
71 |
|
140 | |||
72 |
|
|
141 | test fetch with named branches | |
73 | hg init nbase |
|
142 | ||
74 | echo base > nbase/a |
|
143 | $ hg init nbase | |
75 | hg -R nbase ci -d '1 0' -Am base |
|
144 | $ echo base > nbase/a | |
76 | hg -R nbase branch a |
|
145 | $ hg -R nbase ci -d '1 0' -Am base | |
77 | echo a > nbase/a |
|
146 | adding a | |
78 | hg -R nbase ci -d '2 0' -m a |
|
147 | $ hg -R nbase branch a | |
79 | hg -R nbase up -C 0 |
|
148 | marked working directory as branch a | |
80 | hg -R nbase branch b |
|
149 | $ echo a > nbase/a | |
81 | echo b > nbase/b |
|
150 | $ hg -R nbase ci -d '2 0' -m a | |
82 |
hg -R nbase |
|
151 | $ hg -R nbase up -C 0 | |
|
152 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
153 | $ hg -R nbase branch b | |||
|
154 | marked working directory as branch b | |||
|
155 | $ echo b > nbase/b | |||
|
156 | $ hg -R nbase ci -Ad '3 0' -m b | |||
|
157 | adding b | |||
|
158 | $ echo | |||
|
159 | ||||
|
160 | ||||
|
161 | pull in change on foreign branch | |||
83 |
|
162 | |||
84 | echo |
|
163 | $ hg clone nbase n1 | |
85 | echo % pull in change on foreign branch |
|
164 | updating to branch default | |
86 | hg clone nbase n1 |
|
165 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
87 | hg clone nbase n2 |
|
166 | $ hg clone nbase n2 | |
88 | hg -R n1 up -C a |
|
167 | updating to branch default | |
89 | echo aa > n1/a |
|
168 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
90 | hg -R n1 ci -d '4 0' -m a1 |
|
169 | $ hg -R n1 up -C a | |
|
170 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
171 | $ echo aa > n1/a | |||
|
172 | $ hg -R n1 ci -d '4 0' -m a1 | |||
|
173 | $ hg -R n2 up -C b | |||
|
174 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
175 | $ hg -R n2 fetch -d '9 0' -m 'merge' n1 | |||
|
176 | pulling from n1 | |||
|
177 | searching for changes | |||
|
178 | adding changesets | |||
|
179 | adding manifests | |||
|
180 | adding file changes | |||
|
181 | added 1 changesets with 1 changes to 1 files | |||
91 |
|
182 | |||
92 | hg -R n2 up -C b |
|
183 | parent should be 2 (no automatic update) | |
93 | hg -R n2 fetch -d '9 0' -m 'merge' n1 |
|
|||
94 | echo '% parent should be 2 (no automatic update)' |
|
|||
95 | hg -R n2 parents --template '{rev}\n' |
|
|||
96 | rm -fr n1 n2 |
|
|||
97 |
|
184 | |||
98 | echo |
|
185 | $ hg -R n2 parents --template '{rev}\n' | |
99 | echo % pull in changes on both foreign and local branches |
|
186 | 2 | |
100 | hg clone nbase n1 |
|
187 | $ rm -fr n1 n2 | |
101 | hg clone nbase n2 |
|
188 | $ echo | |
102 | hg -R n1 up -C a |
|
189 | ||
103 | echo aa > n1/a |
|
190 | ||
104 | hg -R n1 ci -d '4 0' -m a1 |
|
191 | pull in changes on both foreign and local branches | |
105 | hg -R n1 up -C b |
|
|||
106 | echo bb > n1/b |
|
|||
107 | hg -R n1 ci -d '5 0' -m b1 |
|
|||
108 |
|
192 | |||
109 | hg -R n2 up -C b |
|
193 | $ hg clone nbase n1 | |
110 | hg -R n2 fetch -d '9 0' -m 'merge' n1 |
|
194 | updating to branch default | |
111 | echo '% parent should be 4 (fast forward)' |
|
195 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
112 | hg -R n2 parents --template '{rev}\n' |
|
196 | $ hg clone nbase n2 | |
113 | rm -fr n1 n2 |
|
197 | updating to branch default | |
|
198 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
199 | $ hg -R n1 up -C a | |||
|
200 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
201 | $ echo aa > n1/a | |||
|
202 | $ hg -R n1 ci -d '4 0' -m a1 | |||
|
203 | $ hg -R n1 up -C b | |||
|
204 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
205 | $ echo bb > n1/b | |||
|
206 | $ hg -R n1 ci -d '5 0' -m b1 | |||
|
207 | $ hg -R n2 up -C b | |||
|
208 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
209 | $ hg -R n2 fetch -d '9 0' -m 'merge' n1 | |||
|
210 | pulling from n1 | |||
|
211 | searching for changes | |||
|
212 | adding changesets | |||
|
213 | adding manifests | |||
|
214 | adding file changes | |||
|
215 | added 2 changesets with 2 changes to 2 files | |||
|
216 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
114 |
|
217 | |||
115 | echo |
|
218 | parent should be 4 (fast forward) | |
116 | echo '% pull changes on foreign (2 new heads) and local (1 new head) branches' |
|
219 | ||
117 | echo % with a local change |
|
220 | $ hg -R n2 parents --template '{rev}\n' | |
118 | hg clone nbase n1 |
|
221 | 4 | |
119 | hg clone nbase n2 |
|
222 | $ rm -fr n1 n2 | |
120 | hg -R n1 up -C a |
|
223 | $ echo | |
121 | echo a1 > n1/a |
|
224 | ||
122 | hg -R n1 ci -d '4 0' -m a1 |
|
225 | ||
123 | hg -R n1 up -C b |
|
226 | pull changes on foreign (2 new heads) and local (1 new head) branches | |
124 | echo bb > n1/b |
|
227 | with a local change | |
125 | hg -R n1 ci -d '5 0' -m b1 |
|
|||
126 | hg -R n1 up -C 1 |
|
|||
127 | echo a2 > n1/a |
|
|||
128 | hg -R n1 ci -d '6 0' -m a2 |
|
|||
129 |
|
228 | |||
130 | hg -R n2 up -C b |
|
229 | $ hg clone nbase n1 | |
131 | echo change >> n2/c |
|
230 | updating to branch default | |
132 | hg -R n2 ci -Ad '7 0' -m local |
|
231 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
133 | hg -R n2 fetch -d '9 0' -m 'merge' n1 |
|
232 | $ hg clone nbase n2 | |
134 | echo '% parent should be 7 (new merge changeset)' |
|
233 | updating to branch default | |
135 | hg -R n2 parents --template '{rev}\n' |
|
234 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
136 | rm -fr n1 n2 |
|
235 | $ hg -R n1 up -C a | |
|
236 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
237 | $ echo a1 > n1/a | |||
|
238 | $ hg -R n1 ci -d '4 0' -m a1 | |||
|
239 | $ hg -R n1 up -C b | |||
|
240 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
241 | $ echo bb > n1/b | |||
|
242 | $ hg -R n1 ci -d '5 0' -m b1 | |||
|
243 | $ hg -R n1 up -C 1 | |||
|
244 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
245 | $ echo a2 > n1/a | |||
|
246 | $ hg -R n1 ci -d '6 0' -m a2 | |||
|
247 | created new head | |||
|
248 | $ hg -R n2 up -C b | |||
|
249 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
250 | $ echo change >> n2/c | |||
|
251 | $ hg -R n2 ci -Ad '7 0' -m local | |||
|
252 | adding c | |||
|
253 | $ hg -R n2 fetch -d '9 0' -m 'merge' n1 | |||
|
254 | pulling from n1 | |||
|
255 | searching for changes | |||
|
256 | adding changesets | |||
|
257 | adding manifests | |||
|
258 | adding file changes | |||
|
259 | added 3 changesets with 3 changes to 2 files (+2 heads) | |||
|
260 | updating to 5:708c6cce3d26 | |||
|
261 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
262 | merging with 3:d83427717b1f | |||
|
263 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
264 | new changeset 7:48f1a33f52af merges remote changes with local | |||
137 |
|
265 | |||
138 | echo '% pull in changes on foreign (merge of local branch) and local (2 new' |
|
266 | parent should be 7 (new merge changeset) | |
139 | echo '% heads) with a local change' |
|
|||
140 | hg clone nbase n1 |
|
|||
141 | hg clone nbase n2 |
|
|||
142 | hg -R n1 up -C a |
|
|||
143 | hg -R n1 merge b |
|
|||
144 | hg -R n1 ci -d '4 0' -m merge |
|
|||
145 | hg -R n1 up -C 2 |
|
|||
146 | echo c > n1/a |
|
|||
147 | hg -R n1 ci -d '5 0' -m c |
|
|||
148 | hg -R n1 up -C 2 |
|
|||
149 | echo cc > n1/a |
|
|||
150 | hg -R n1 ci -d '6 0' -m cc |
|
|||
151 |
|
267 | |||
152 | hg -R n2 up -C b |
|
268 | $ hg -R n2 parents --template '{rev}\n' | |
153 | echo change >> n2/b |
|
269 | 7 | |
154 | hg -R n2 ci -Ad '7 0' -m local |
|
270 | $ rm -fr n1 n2 | |
155 | hg -R n2 fetch -d '9 0' -m 'merge' n1 |
|
271 | ||
156 | echo '% parent should be 3 (fetch did not merge anything)' |
|
272 | pull in changes on foreign (merge of local branch) and local (2 new | |
157 | hg -R n2 parents --template '{rev}\n' |
|
273 | heads) with a local change | |
158 | rm -fr n1 n2 |
|
|||
159 |
|
274 | |||
160 | echo % pull in change on different branch than dirstate |
|
275 | $ hg clone nbase n1 | |
161 | hg init n1 |
|
276 | updating to branch default | |
162 | echo a > n1/a |
|
277 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
163 | hg -R n1 ci -Am initial |
|
278 | $ hg clone nbase n2 | |
164 | hg clone n1 n2 |
|
279 | updating to branch default | |
165 | echo b > n1/a |
|
280 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
166 |
hg -R n1 |
|
281 | $ hg -R n1 up -C a | |
167 | hg -R n2 branch topic |
|
282 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
168 | hg -R n2 fetch -d '0 0' -m merge n1 |
|
283 | $ hg -R n1 merge b | |
169 | echo '% parent should be 0 (fetch did not update or merge anything)' |
|
284 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
170 | hg -R n2 parents --template '{rev}\n' |
|
285 | (branch merge, don't forget to commit) | |
171 | rm -fr n1 n2 |
|
286 | $ hg -R n1 ci -d '4 0' -m merge | |
|
287 | $ hg -R n1 up -C 2 | |||
|
288 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
289 | $ echo c > n1/a | |||
|
290 | $ hg -R n1 ci -d '5 0' -m c | |||
|
291 | $ hg -R n1 up -C 2 | |||
|
292 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
293 | $ echo cc > n1/a | |||
|
294 | $ hg -R n1 ci -d '6 0' -m cc | |||
|
295 | created new head | |||
|
296 | $ hg -R n2 up -C b | |||
|
297 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
298 | $ echo change >> n2/b | |||
|
299 | $ hg -R n2 ci -Ad '7 0' -m local | |||
|
300 | $ hg -R n2 fetch -d '9 0' -m 'merge' n1 | |||
|
301 | pulling from n1 | |||
|
302 | searching for changes | |||
|
303 | adding changesets | |||
|
304 | adding manifests | |||
|
305 | adding file changes | |||
|
306 | added 3 changesets with 2 changes to 1 files (+2 heads) | |||
|
307 | not merging with 1 other new branch heads (use "hg heads ." and "hg merge" to merge them) | |||
172 |
|
308 | |||
173 | echo % test fetch with inactive branches |
|
309 | parent should be 3 (fetch did not merge anything) | |
174 | hg init ib1 |
|
310 | ||
175 | echo a > ib1/a |
|
311 | $ hg -R n2 parents --template '{rev}\n' | |
176 | hg --cwd ib1 ci -Am base |
|
312 | 3 | |
177 | hg --cwd ib1 branch second |
|
313 | $ rm -fr n1 n2 | |
178 | echo b > ib1/b |
|
314 | ||
179 | hg --cwd ib1 ci -Am onsecond |
|
315 | pull in change on different branch than dirstate | |
180 | hg --cwd ib1 branch -f default |
|
316 | ||
181 | echo c > ib1/c |
|
317 | $ hg init n1 | |
182 | hg --cwd ib1 ci -Am newdefault |
|
318 | $ echo a > n1/a | |
183 | hg clone ib1 ib2 |
|
319 | $ hg -R n1 ci -Am initial | |
184 | echo % fetch should succeed |
|
320 | adding a | |
185 | hg --cwd ib2 fetch ../ib1 |
|
321 | $ hg clone n1 n2 | |
186 | rm -fr ib1 ib2 |
|
322 | updating to branch default | |
|
323 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
324 | $ echo b > n1/a | |||
|
325 | $ hg -R n1 ci -m next | |||
|
326 | $ hg -R n2 branch topic | |||
|
327 | marked working directory as branch topic | |||
|
328 | $ hg -R n2 fetch -d '0 0' -m merge n1 | |||
|
329 | abort: working dir not at branch tip (use "hg update" to check out branch tip) | |||
|
330 | [255] | |||
|
331 | ||||
|
332 | parent should be 0 (fetch did not update or merge anything) | |||
|
333 | ||||
|
334 | $ hg -R n2 parents --template '{rev}\n' | |||
|
335 | 0 | |||
|
336 | $ rm -fr n1 n2 | |||
|
337 | ||||
|
338 | test fetch with inactive branches | |||
187 |
|
339 | |||
188 | echo % test issue1726 |
|
340 | $ hg init ib1 | |
189 | hg init i1726r1 |
|
341 | $ echo a > ib1/a | |
190 | echo a > i1726r1/a |
|
342 | $ hg --cwd ib1 ci -Am base | |
191 | hg --cwd i1726r1 ci -Am base |
|
343 | adding a | |
192 | hg clone i1726r1 i1726r2 |
|
344 | $ hg --cwd ib1 branch second | |
193 | echo b > i1726r1/a |
|
345 | marked working directory as branch second | |
194 | hg --cwd i1726r1 ci -m second |
|
346 | $ echo b > ib1/b | |
195 | echo c > i1726r2/a |
|
347 | $ hg --cwd ib1 ci -Am onsecond | |
196 | hg --cwd i1726r2 ci -m third |
|
348 | adding b | |
197 | HGMERGE=true hg --cwd i1726r2 fetch ../i1726r1 | sed 's/new changeset 3:[0-9a-zA-Z]* /new changeset 3 /' |
|
349 | $ hg --cwd ib1 branch -f default | |
198 | hg --cwd i1726r2 heads default --template '{rev}\n' |
|
350 | marked working directory as branch default | |
|
351 | $ echo c > ib1/c | |||
|
352 | $ hg --cwd ib1 ci -Am newdefault | |||
|
353 | adding c | |||
|
354 | created new head | |||
|
355 | $ hg clone ib1 ib2 | |||
|
356 | updating to branch default | |||
|
357 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
358 | ||||
|
359 | fetch should succeed | |||
|
360 | ||||
|
361 | $ hg --cwd ib2 fetch ../ib1 | |||
|
362 | pulling from ../ib1 | |||
|
363 | searching for changes | |||
|
364 | no changes found | |||
|
365 | $ rm -fr ib1 ib2 | |||
|
366 | ||||
|
367 | test issue1726 | |||
199 |
|
368 | |||
200 | echo |
|
369 | $ hg init i1726r1 | |
201 | echo % test issue2047 |
|
370 | $ echo a > i1726r1/a | |
202 | hg -q init i2047a |
|
371 | $ hg --cwd i1726r1 ci -Am base | |
203 | cd i2047a |
|
372 | adding a | |
204 | echo a > a |
|
373 | $ hg clone i1726r1 i1726r2 | |
205 | hg -q ci -Am a |
|
374 | updating to branch default | |
206 | hg -q branch stable |
|
375 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
207 | echo b > b |
|
376 | $ echo b > i1726r1/a | |
208 | hg -q ci -Am b |
|
377 | $ hg --cwd i1726r1 ci -m second | |
209 | cd .. |
|
378 | $ echo c > i1726r2/a | |
210 | hg -q clone -r 0 i2047a i2047b |
|
379 | $ hg --cwd i1726r2 ci -m third | |
211 | cd i2047b |
|
380 | $ HGMERGE=true hg --cwd i1726r2 fetch ../i1726r1 | |
212 | hg fetch ../i2047a |
|
381 | pulling from ../i1726r1 | |
|
382 | searching for changes | |||
|
383 | adding changesets | |||
|
384 | adding manifests | |||
|
385 | adding file changes | |||
|
386 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
387 | updating to 2:7837755a2789 | |||
|
388 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
389 | merging with 1:d1f0c6c48ebd | |||
|
390 | merging a | |||
|
391 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
392 | new changeset 3:* merges remote changes with local (glob) | |||
|
393 | $ hg --cwd i1726r2 heads default --template '{rev}\n' | |||
|
394 | 3 | |||
|
395 | $ echo | |||
|
396 | ||||
213 |
|
397 | |||
214 | "$TESTDIR/killdaemons.py" |
|
398 | test issue2047 | |
215 |
|
399 | |||
216 | true |
|
400 | $ hg -q init i2047a | |
|
401 | $ cd i2047a | |||
|
402 | $ echo a > a | |||
|
403 | $ hg -q ci -Am a | |||
|
404 | $ hg -q branch stable | |||
|
405 | $ echo b > b | |||
|
406 | $ hg -q ci -Am b | |||
|
407 | $ cd .. | |||
|
408 | $ hg -q clone -r 0 i2047a i2047b | |||
|
409 | $ cd i2047b | |||
|
410 | $ hg fetch ../i2047a | |||
|
411 | pulling from ../i2047a | |||
|
412 | searching for changes | |||
|
413 | adding changesets | |||
|
414 | adding manifests | |||
|
415 | adding file changes | |||
|
416 | added 1 changesets with 1 changes to 1 files | |||
|
417 | $ "$TESTDIR/killdaemons.py" |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now