Mercurial > hg
annotate tests/test-push-warn.t @ 14382:2d16f15da7bd
patch: remove patch.patch() cwd argument
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 19 May 2011 22:44:01 +0200 |
parents | cb98fed52495 |
children | 826a13720fbc |
rev | line source |
---|---|
12279 | 1 $ echo "[extensions]" >> $HGRCPATH |
2 $ echo "graphlog=" >> $HGRCPATH | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
3 |
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
13550
diff
changeset
|
4 $ hg init a |
12279 | 5 $ cd a |
6 $ echo foo > t1 | |
7 $ hg add t1 | |
8 $ hg commit -m "1" | |
10875
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
9 |
12279 | 10 $ cd .. |
11 $ hg clone a b | |
12 updating to branch default | |
13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
14 | |
15 $ cd a | |
16 $ echo foo > t2 | |
17 $ hg add t2 | |
18 $ hg commit -m "2" | |
19 | |
20 $ cd ../b | |
21 $ echo foo > t3 | |
22 $ hg add t3 | |
23 $ hg commit -m "3" | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
24 |
12279 | 25 $ hg push ../a |
26 pushing to ../a | |
27 searching for changes | |
28 abort: push creates new remote heads on branch 'default'! | |
29 (you should pull and merge or use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
30 [255] |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
31 |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
32 $ hg push --debug ../a |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
33 pushing to ../a |
14164
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
34 query 1; heads |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
35 searching for changes |
14164
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
36 taking quick initial sample |
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
37 searching: 2 queries |
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
38 query 2; still undecided: 2, sample size is: 2 |
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
39 2 total queries |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
40 new remote heads on branch 'default' |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
41 new remote head 1e108cc5548c |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
42 abort: push creates new remote heads on branch 'default'! |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
43 (you should pull and merge or use push -f to force) |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
44 [255] |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
45 |
12279 | 46 $ hg pull ../a |
47 pulling from ../a | |
48 searching for changes | |
49 adding changesets | |
50 adding manifests | |
51 adding file changes | |
52 added 1 changesets with 1 changes to 1 files (+1 heads) | |
53 (run 'hg heads' to see heads, 'hg merge' to merge) | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
54 |
12279 | 55 $ hg push ../a |
56 pushing to ../a | |
57 searching for changes | |
58 abort: push creates new remote heads on branch 'default'! | |
59 (did you forget to merge? use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
60 [255] |
12279 | 61 |
62 $ hg merge | |
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
64 (branch merge, don't forget to commit) | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
65 |
12279 | 66 $ hg commit -m "4" |
67 $ hg push ../a | |
68 pushing to ../a | |
69 searching for changes | |
70 adding changesets | |
71 adding manifests | |
72 adding file changes | |
73 added 2 changesets with 1 changes to 1 files | |
74 | |
75 $ cd .. | |
76 | |
77 $ hg init c | |
78 $ cd c | |
79 $ for i in 0 1 2; do | |
80 > echo $i >> foo | |
81 > hg ci -Am $i | |
82 > done | |
83 adding foo | |
84 $ cd .. | |
85 | |
86 $ hg clone c d | |
87 updating to branch default | |
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
89 |
12279 | 90 $ cd d |
91 $ for i in 0 1; do | |
92 > hg co -C $i | |
93 > echo d-$i >> foo | |
94 > hg ci -m d-$i | |
95 > done | |
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
97 created new head | |
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
99 created new head | |
100 | |
101 $ HGMERGE=true hg merge 3 | |
102 merging foo | |
103 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
104 (branch merge, don't forget to commit) | |
105 | |
106 $ hg ci -m c-d | |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
107 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
108 $ hg push ../c |
12279 | 109 pushing to ../c |
110 searching for changes | |
111 abort: push creates new remote heads on branch 'default'! | |
112 (did you forget to merge? use push -f to force) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
113 [255] |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
114 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
115 $ hg push -r 2 ../c |
12279 | 116 pushing to ../c |
117 searching for changes | |
118 no changes found | |
119 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
120 $ hg push -r 3 ../c |
12279 | 121 pushing to ../c |
122 searching for changes | |
123 abort: push creates new remote heads on branch 'default'! | |
124 (did you forget to merge? use push -f to force) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
125 [255] |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
126 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
127 $ hg push -r 3 -r 4 ../c |
12279 | 128 pushing to ../c |
129 searching for changes | |
130 abort: push creates new remote heads on branch 'default'! | |
131 (did you forget to merge? use push -f to force) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
132 [255] |
12279 | 133 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
134 $ hg push -f -r 3 -r 4 ../c |
12279 | 135 pushing to ../c |
136 searching for changes | |
137 adding changesets | |
138 adding manifests | |
139 adding file changes | |
140 added 2 changesets with 2 changes to 1 files (+2 heads) | |
141 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
142 $ hg push -r 5 ../c |
12279 | 143 pushing to ../c |
144 searching for changes | |
145 adding changesets | |
146 adding manifests | |
147 adding file changes | |
148 added 1 changesets with 1 changes to 1 files (-1 heads) | |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
149 |
12279 | 150 $ hg in ../c |
151 comparing with ../c | |
152 searching for changes | |
153 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
154 [1] |
12279 | 155 |
156 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
157 Issue450: push -r warns about remote head creation even if no heads |
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
158 will be created |
3923
27230c29bfec
fix calculation of new heads added during push with -r
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3803
diff
changeset
|
159 |
12279 | 160 $ hg init ../e |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
161 $ hg push -r 0 ../e |
12279 | 162 pushing to ../e |
163 searching for changes | |
164 adding changesets | |
165 adding manifests | |
166 adding file changes | |
167 added 1 changesets with 1 changes to 1 files | |
168 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
169 $ hg push -r 1 ../e |
12279 | 170 pushing to ../e |
171 searching for changes | |
172 adding changesets | |
173 adding manifests | |
174 adding file changes | |
175 added 1 changesets with 1 changes to 1 files | |
176 | |
177 $ cd .. | |
178 | |
179 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
180 Issue736: named branches are not considered for detection of |
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
181 unmerged heads in "hg push" |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
182 |
12279 | 183 $ hg init f |
184 $ cd f | |
185 $ hg -q branch a | |
186 $ echo 0 > foo | |
187 $ hg -q ci -Am 0 | |
188 $ echo 1 > foo | |
189 $ hg -q ci -m 1 | |
190 $ hg -q up 0 | |
191 $ echo 2 > foo | |
192 $ hg -q ci -m 2 | |
193 $ hg -q up 0 | |
194 $ hg -q branch b | |
195 $ echo 3 > foo | |
196 $ hg -q ci -m 3 | |
197 $ cd .. | |
198 | |
199 $ hg -q clone f g | |
200 $ cd g | |
201 | |
202 Push on existing branch and new branch: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
203 |
12279 | 204 $ hg -q up 1 |
205 $ echo 4 > foo | |
206 $ hg -q ci -m 4 | |
207 $ hg -q up 0 | |
208 $ echo 5 > foo | |
209 $ hg -q branch c | |
210 $ hg -q ci -m 5 | |
211 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
212 $ hg push ../f |
12279 | 213 pushing to ../f |
214 searching for changes | |
215 abort: push creates new remote branches: c! | |
216 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
217 [255] |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
218 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
219 $ hg push -r 4 -r 5 ../f |
12279 | 220 pushing to ../f |
221 searching for changes | |
222 abort: push creates new remote branches: c! | |
223 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
224 [255] |
12279 | 225 |
226 | |
227 Multiple new branches: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
228 |
12279 | 229 $ hg -q branch d |
230 $ echo 6 > foo | |
231 $ hg -q ci -m 6 | |
232 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
233 $ hg push ../f |
12279 | 234 pushing to ../f |
235 searching for changes | |
236 abort: push creates new remote branches: c, d! | |
237 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
238 [255] |
10354
844d83da2da9
prepush: warn about every new outgoing named branch, not just the first
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
9954
diff
changeset
|
239 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
240 $ hg push -r 4 -r 6 ../f |
12279 | 241 pushing to ../f |
242 searching for changes | |
243 abort: push creates new remote branches: c, d! | |
244 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
245 [255] |
12279 | 246 |
247 $ cd ../g | |
248 | |
249 | |
250 Fail on multiple head push: | |
251 | |
252 $ hg -q up 1 | |
253 $ echo 7 > foo | |
254 $ hg -q ci -m 7 | |
255 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
256 $ hg push -r 4 -r 7 ../f |
12279 | 257 pushing to ../f |
258 searching for changes | |
259 abort: push creates new remote heads on branch 'a'! | |
260 (did you forget to merge? use push -f to force) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
261 [255] |
12279 | 262 |
263 Push replacement head on existing branches: | |
264 | |
265 $ hg -q up 3 | |
266 $ echo 8 > foo | |
267 $ hg -q ci -m 8 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
268 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
269 $ hg push -r 7 -r 8 ../f |
12279 | 270 pushing to ../f |
271 searching for changes | |
272 adding changesets | |
273 adding manifests | |
274 adding file changes | |
275 added 2 changesets with 2 changes to 1 files | |
276 | |
277 | |
278 Merge of branch a to other branch b followed by unrelated push | |
279 on branch a: | |
280 | |
281 $ hg -q up 7 | |
282 $ HGMERGE=true hg -q merge 8 | |
283 $ hg -q ci -m 9 | |
284 $ hg -q up 8 | |
285 $ echo 10 > foo | |
286 $ hg -q ci -m 10 | |
287 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
288 $ hg push -r 9 ../f |
12279 | 289 pushing to ../f |
290 searching for changes | |
291 adding changesets | |
292 adding manifests | |
293 adding file changes | |
294 added 1 changesets with 1 changes to 1 files (-1 heads) | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
295 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
296 $ hg push -r 10 ../f |
12279 | 297 pushing to ../f |
298 searching for changes | |
299 adding changesets | |
300 adding manifests | |
301 adding file changes | |
302 added 1 changesets with 1 changes to 1 files (+1 heads) | |
303 | |
304 | |
305 Cheating the counting algorithm: | |
306 | |
307 $ hg -q up 9 | |
308 $ HGMERGE=true hg -q merge 2 | |
309 $ hg -q ci -m 11 | |
310 $ hg -q up 1 | |
311 $ echo 12 > foo | |
312 $ hg -q ci -m 12 | |
313 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
314 $ hg push -r 11 -r 12 ../f |
12279 | 315 pushing to ../f |
316 searching for changes | |
317 adding changesets | |
318 adding manifests | |
319 adding file changes | |
320 added 2 changesets with 2 changes to 1 files | |
321 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
322 |
12279 | 323 Failed push of new named branch: |
324 | |
325 $ echo 12 > foo | |
326 $ hg -q ci -m 12a | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
327 [1] |
12279 | 328 $ hg -q up 11 |
329 $ echo 13 > foo | |
330 $ hg -q branch e | |
331 $ hg -q ci -m 13d | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
332 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
333 $ hg push -r 12 -r 13 ../f |
12279 | 334 pushing to ../f |
335 searching for changes | |
336 abort: push creates new remote branches: e! | |
337 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
338 [255] |
12279 | 339 |
340 | |
341 Using --new-branch to push new named branch: | |
11211
e43c23d189a5
push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents:
10925
diff
changeset
|
342 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
343 $ hg push --new-branch -r 12 -r 13 ../f |
12279 | 344 pushing to ../f |
345 searching for changes | |
346 adding changesets | |
347 adding manifests | |
348 adding file changes | |
349 added 1 changesets with 1 changes to 1 files | |
350 | |
11211
e43c23d189a5
push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents:
10925
diff
changeset
|
351 |
12785
c7d23b4ca4ba
check-code: warning and fixes for whitespace in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12399
diff
changeset
|
352 Checking prepush logic does not allow silently pushing |
12279 | 353 multiple new heads: |
354 | |
355 $ cd .. | |
356 $ hg init h | |
357 $ echo init > h/init | |
358 $ hg -R h ci -Am init | |
359 adding init | |
360 $ echo a > h/a | |
361 $ hg -R h ci -Am a | |
362 adding a | |
363 $ hg clone h i | |
364 updating to branch default | |
365 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
366 $ hg -R h up 0 | |
367 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
368 $ echo b > h/b | |
369 $ hg -R h ci -Am b | |
370 adding b | |
371 created new head | |
372 $ hg -R i up 0 | |
373 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
374 $ echo c > i/c | |
375 $ hg -R i ci -Am c | |
376 adding c | |
377 created new head | |
9479
f3569d95c2ab
push: fix subtle bug in prepush logic
Sune Foldager <cryo@cyanite.org>
parents:
8565
diff
changeset
|
378 |
12279 | 379 $ hg -R i push h |
380 pushing to h | |
381 searching for changes | |
382 abort: push creates new remote heads on branch 'default'! | |
383 (you should pull and merge or use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
384 [255] |
12279 | 385 |
386 | |
387 Check prepush logic with merged branches: | |
388 | |
389 $ hg init j | |
390 $ hg -R j branch a | |
391 marked working directory as branch a | |
392 $ echo init > j/foo | |
393 $ hg -R j ci -Am init | |
394 adding foo | |
395 $ hg clone j k | |
396 updating to branch a | |
397 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
398 $ echo a1 > j/foo | |
399 $ hg -R j ci -m a1 | |
400 $ hg -R k branch b | |
401 marked working directory as branch b | |
402 $ echo b > k/foo | |
403 $ hg -R k ci -m b | |
404 $ hg -R k up 0 | |
405 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
406 | |
407 $ hg -R k merge b | |
408 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
409 (branch merge, don't forget to commit) | |
410 | |
411 $ hg -R k ci -m merge | |
9954
d6a307719ccb
fix bug in prepush logic involving merge changesets
Sune Foldager <cryo@cyanite.org>
parents:
9609
diff
changeset
|
412 |
12279 | 413 $ hg -R k push -r a j |
414 pushing to j | |
415 searching for changes | |
416 abort: push creates new remote branches: b! | |
417 (use 'hg push --new-branch' to create new remote branches) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
418 [255] |
12279 | 419 |
420 | |
421 Prepush -r should not allow you to sneak in new heads: | |
10875
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
422 |
12279 | 423 $ hg init l |
424 $ cd l | |
425 $ echo a >> foo | |
426 $ hg -q add foo | |
427 $ hg -q branch a | |
428 $ hg -q ci -ma | |
429 $ hg -q up null | |
430 $ echo a >> foo | |
431 $ hg -q add foo | |
432 $ hg -q branch b | |
433 $ hg -q ci -mb | |
434 $ cd .. | |
435 $ hg -q clone l m -u a | |
436 $ cd m | |
437 $ hg -q merge b | |
438 $ hg -q ci -mmb | |
439 $ hg -q up 0 | |
440 $ echo a >> foo | |
441 $ hg -q ci -ma2 | |
442 $ hg -q up 2 | |
443 $ echo a >> foo | |
444 $ hg -q branch -f b | |
445 $ hg -q ci -mb2 | |
446 $ hg -q merge 3 | |
447 $ hg -q ci -mma | |
448 | |
449 $ hg push ../l -b b | |
450 pushing to ../l | |
451 searching for changes | |
452 abort: push creates new remote heads on branch 'a'! | |
453 (did you forget to merge? use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
454 [255] |
12279 | 455 |
456 $ cd .. | |
457 | |
458 | |
459 Check prepush with new branch head on former topo non-head: | |
460 | |
461 $ hg init n | |
462 $ cd n | |
463 $ hg branch A | |
464 marked working directory as branch A | |
465 $ echo a >a | |
466 $ hg ci -Ama | |
467 adding a | |
468 $ hg branch B | |
469 marked working directory as branch B | |
470 $ echo b >b | |
471 $ hg ci -Amb | |
472 adding b | |
473 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
474 b is now branch head of B, and a topological head |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
475 a is now branch head of A, but not a topological head |
12279 | 476 |
477 $ hg clone . inner | |
478 updating to branch B | |
479 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
480 $ cd inner | |
481 $ hg up B | |
482 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
483 $ echo b1 >b1 | |
484 $ hg ci -Amb1 | |
485 adding b1 | |
486 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
487 in the clone b1 is now the head of B |
12279 | 488 |
489 $ cd .. | |
490 $ hg up 0 | |
491 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
492 $ echo a2 >a2 | |
493 $ hg ci -Ama2 | |
494 adding a2 | |
495 | |
12785
c7d23b4ca4ba
check-code: warning and fixes for whitespace in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12399
diff
changeset
|
496 a2 is now the new branch head of A, and a new topological head |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
497 it replaces a former inner branch head, so it should at most warn about |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
498 A, not B |
12279 | 499 |
500 glog of local: | |
501 | |
502 $ hg glog --template "{rev}: {branches} {desc}\n" | |
503 @ 2: A a2 | |
504 | | |
505 | o 1: B b | |
506 |/ | |
507 o 0: A a | |
508 | |
509 glog of remote: | |
510 | |
511 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
512 @ 2: B b1 | |
513 | | |
514 o 1: B b | |
515 | | |
516 o 0: A a | |
517 | |
518 outgoing: | |
519 | |
520 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
521 comparing with inner | |
522 searching for changes | |
523 2: A a2 | |
524 | |
525 $ hg push inner | |
526 pushing to inner | |
527 searching for changes | |
528 adding changesets | |
529 adding manifests | |
530 adding file changes | |
531 added 1 changesets with 1 changes to 1 files (+1 heads) | |
532 | |
533 $ cd .. | |
534 | |
535 | |
536 Check prepush with new branch head on former topo head: | |
10875
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
537 |
12279 | 538 $ hg init o |
539 $ cd o | |
540 $ hg branch A | |
541 marked working directory as branch A | |
542 $ echo a >a | |
543 $ hg ci -Ama | |
544 adding a | |
545 $ hg branch B | |
546 marked working directory as branch B | |
547 $ echo b >b | |
548 $ hg ci -Amb | |
549 adding b | |
550 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
551 b is now branch head of B, and a topological head |
12279 | 552 |
553 $ hg up 0 | |
554 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
555 $ echo a1 >a1 | |
556 $ hg ci -Ama1 | |
557 adding a1 | |
558 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
559 a1 is now branch head of A, and a topological head |
12279 | 560 |
561 $ hg clone . inner | |
562 updating to branch A | |
563 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
564 $ cd inner | |
565 $ hg up B | |
566 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
567 $ echo b1 >b1 | |
568 $ hg ci -Amb1 | |
569 adding b1 | |
570 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
571 in the clone b1 is now the head of B |
12279 | 572 |
573 $ cd .. | |
574 $ echo a2 >a2 | |
575 $ hg ci -Ama2 | |
576 adding a2 | |
577 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
578 a2 is now the new branch head of A, and a topological head |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
579 it replaces a former topological and branch head, so this should not warn |
12279 | 580 |
581 glog of local: | |
582 | |
583 $ hg glog --template "{rev}: {branches} {desc}\n" | |
584 @ 3: A a2 | |
585 | | |
586 o 2: A a1 | |
587 | | |
588 | o 1: B b | |
589 |/ | |
590 o 0: A a | |
591 | |
592 glog of remote: | |
593 | |
594 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
595 @ 3: B b1 | |
596 | | |
597 | o 2: A a1 | |
598 | | | |
599 o | 1: B b | |
600 |/ | |
601 o 0: A a | |
602 | |
603 outgoing: | |
604 | |
605 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
606 comparing with inner | |
607 searching for changes | |
608 3: A a2 | |
609 | |
610 $ hg push inner | |
611 pushing to inner | |
612 searching for changes | |
613 adding changesets | |
614 adding manifests | |
615 adding file changes | |
616 added 1 changesets with 1 changes to 1 files | |
617 | |
618 $ cd .. | |
619 | |
620 | |
621 Check prepush with new branch head and new child of former branch head | |
622 but child is on different branch: | |
623 | |
624 $ hg init p | |
625 $ cd p | |
626 $ hg branch A | |
627 marked working directory as branch A | |
628 $ echo a0 >a | |
629 $ hg ci -Ama0 | |
630 adding a | |
631 $ echo a1 >a | |
632 $ hg ci -ma1 | |
633 $ hg up null | |
634 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
635 $ hg branch B | |
636 marked working directory as branch B | |
637 $ echo b0 >b | |
638 $ hg ci -Amb0 | |
639 adding b | |
640 $ echo b1 >b | |
641 $ hg ci -mb1 | |
642 | |
643 $ hg clone . inner | |
644 updating to branch B | |
645 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
10771
01f097c4ae66
push: fix bug in prepush logic and its tests
Sune Foldager <cryo@cyanite.org>
parents:
10354
diff
changeset
|
646 |
12279 | 647 $ hg up A |
648 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
649 $ hg branch -f B | |
650 marked working directory as branch B | |
651 $ echo a3 >a | |
652 $ hg ci -ma3 | |
653 created new head | |
654 $ hg up 3 | |
655 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
656 $ hg branch -f A | |
657 marked working directory as branch A | |
658 $ echo b3 >b | |
659 $ hg ci -mb3 | |
660 created new head | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
661 |
12279 | 662 glog of local: |
663 | |
664 $ hg glog --template "{rev}: {branches} {desc}\n" | |
665 @ 5: A b3 | |
666 | | |
667 | o 4: B a3 | |
668 | | | |
669 o | 3: B b1 | |
670 | | | |
671 o | 2: B b0 | |
672 / | |
673 o 1: A a1 | |
674 | | |
675 o 0: A a0 | |
676 | |
677 glog of remote: | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
678 |
12279 | 679 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" |
680 @ 3: B b1 | |
681 | | |
682 o 2: B b0 | |
683 | |
684 o 1: A a1 | |
685 | | |
686 o 0: A a0 | |
687 | |
688 outgoing: | |
689 | |
690 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
691 comparing with inner | |
692 searching for changes | |
693 4: B a3 | |
694 5: A b3 | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
695 |
12279 | 696 $ hg push inner |
697 pushing to inner | |
698 searching for changes | |
699 abort: push creates new remote heads on branch 'A'! | |
700 (did you forget to merge? use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
701 [255] |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
702 |
12279 | 703 $ hg push inner -r4 -r5 |
704 pushing to inner | |
705 searching for changes | |
706 abort: push creates new remote heads on branch 'A'! | |
707 (did you forget to merge? use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
708 [255] |
12279 | 709 |
710 $ hg in inner | |
711 comparing with inner | |
712 searching for changes | |
713 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
714 [1] |