Mercurial > hg
annotate tests/test-push-warn.t @ 15718:c604a3d1969d
icasefs: disuse length check against un-normcase()-ed filenames
this patch disuses length check against un-normcase()-ed filenames
gotten by "os.listdir()", because there is no assurance that
filesystem stores filenames normalized except in letter case, even
though some case insensitive filesystems (in some environment, for
some language setting) store them in such manner.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 24 Dec 2011 00:50:56 +0900 |
parents | 41885892796e |
children | 90f8b8dd0326 |
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 | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
28 abort: push creates new remote head 1e108cc5548c! |
12279 | 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 |
14624
f03c82d1f50a
setdiscovery: batch heads and known(ownheads)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14526
diff
changeset
|
38 query 2; still undecided: 1, sample size is: 1 |
14164
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 |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
42 abort: push creates new remote head 1e108cc5548c! |
12998
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 | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
58 abort: push creates new remote head 1e108cc5548c! |
12279 | 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 | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
111 abort: push creates new remote head 6346d66eb9f5! |
12279 | 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 | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
123 abort: push creates new remote head a5dda829a167! |
12279 | 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 |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
127 $ hg push -v -r 3 -r 4 ../c |
12279 | 128 pushing to ../c |
129 searching for changes | |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
130 new remote heads on branch 'default' |
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
131 new remote head a5dda829a167 |
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
132 new remote head ee8fbc7a0295 |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
133 abort: push creates new remote head a5dda829a167! |
12279 | 134 (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
|
135 [255] |
12279 | 136 |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
137 $ hg push -v -f -r 3 -r 4 ../c |
12279 | 138 pushing to ../c |
139 searching for changes | |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
140 2 changesets found |
12279 | 141 adding changesets |
142 adding manifests | |
143 adding file changes | |
144 added 2 changesets with 2 changes to 1 files (+2 heads) | |
145 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
146 $ hg push -r 5 ../c |
12279 | 147 pushing to ../c |
148 searching for changes | |
149 adding changesets | |
150 adding manifests | |
151 adding file changes | |
152 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
|
153 |
12279 | 154 $ hg in ../c |
155 comparing with ../c | |
156 searching for changes | |
157 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
158 [1] |
12279 | 159 |
160 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
161 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
|
162 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
|
163 |
12279 | 164 $ hg init ../e |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
165 $ hg push -r 0 ../e |
12279 | 166 pushing to ../e |
167 searching for changes | |
168 adding changesets | |
169 adding manifests | |
170 adding file changes | |
171 added 1 changesets with 1 changes to 1 files | |
172 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
173 $ hg push -r 1 ../e |
12279 | 174 pushing to ../e |
175 searching for changes | |
176 adding changesets | |
177 adding manifests | |
178 adding file changes | |
179 added 1 changesets with 1 changes to 1 files | |
180 | |
181 $ cd .. | |
182 | |
183 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
184 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
|
185 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
|
186 |
12279 | 187 $ hg init f |
188 $ cd f | |
189 $ hg -q branch a | |
190 $ echo 0 > foo | |
191 $ hg -q ci -Am 0 | |
192 $ echo 1 > foo | |
193 $ hg -q ci -m 1 | |
194 $ hg -q up 0 | |
195 $ echo 2 > foo | |
196 $ hg -q ci -m 2 | |
197 $ hg -q up 0 | |
198 $ hg -q branch b | |
199 $ echo 3 > foo | |
200 $ hg -q ci -m 3 | |
201 $ cd .. | |
202 | |
203 $ hg -q clone f g | |
204 $ cd g | |
205 | |
206 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
|
207 |
12279 | 208 $ hg -q up 1 |
209 $ echo 4 > foo | |
210 $ hg -q ci -m 4 | |
211 $ hg -q up 0 | |
212 $ echo 5 > foo | |
213 $ hg -q branch c | |
214 $ hg -q ci -m 5 | |
215 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
216 $ hg push ../f |
12279 | 217 pushing to ../f |
218 searching for changes | |
219 abort: push creates new remote branches: c! | |
220 (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
|
221 [255] |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
222 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
223 $ hg push -r 4 -r 5 ../f |
12279 | 224 pushing to ../f |
225 searching for changes | |
226 abort: push creates new remote branches: c! | |
227 (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
|
228 [255] |
12279 | 229 |
230 | |
231 Multiple new branches: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
232 |
12279 | 233 $ hg -q branch d |
234 $ echo 6 > foo | |
235 $ hg -q ci -m 6 | |
236 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
237 $ hg push ../f |
12279 | 238 pushing to ../f |
239 searching for changes | |
240 abort: push creates new remote branches: c, d! | |
241 (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
|
242 [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
|
243 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
244 $ hg push -r 4 -r 6 ../f |
12279 | 245 pushing to ../f |
246 searching for changes | |
247 abort: push creates new remote branches: c, d! | |
248 (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
|
249 [255] |
12279 | 250 |
251 $ cd ../g | |
252 | |
253 | |
254 Fail on multiple head push: | |
255 | |
256 $ hg -q up 1 | |
257 $ echo 7 > foo | |
258 $ hg -q ci -m 7 | |
259 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
260 $ hg push -r 4 -r 7 ../f |
12279 | 261 pushing to ../f |
262 searching for changes | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
263 abort: push creates new remote head 0b715ef6ff8f on branch 'a'! |
12279 | 264 (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
|
265 [255] |
12279 | 266 |
267 Push replacement head on existing branches: | |
268 | |
269 $ hg -q up 3 | |
270 $ echo 8 > foo | |
271 $ 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
|
272 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
273 $ hg push -r 7 -r 8 ../f |
12279 | 274 pushing to ../f |
275 searching for changes | |
276 adding changesets | |
277 adding manifests | |
278 adding file changes | |
279 added 2 changesets with 2 changes to 1 files | |
280 | |
281 | |
282 Merge of branch a to other branch b followed by unrelated push | |
283 on branch a: | |
284 | |
285 $ hg -q up 7 | |
286 $ HGMERGE=true hg -q merge 8 | |
287 $ hg -q ci -m 9 | |
288 $ hg -q up 8 | |
289 $ echo 10 > foo | |
290 $ hg -q ci -m 10 | |
291 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
292 $ hg push -r 9 ../f |
12279 | 293 pushing to ../f |
294 searching for changes | |
295 adding changesets | |
296 adding manifests | |
297 adding file changes | |
298 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
|
299 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
300 $ hg push -r 10 ../f |
12279 | 301 pushing to ../f |
302 searching for changes | |
303 adding changesets | |
304 adding manifests | |
305 adding file changes | |
306 added 1 changesets with 1 changes to 1 files (+1 heads) | |
307 | |
308 | |
309 Cheating the counting algorithm: | |
310 | |
311 $ hg -q up 9 | |
312 $ HGMERGE=true hg -q merge 2 | |
313 $ hg -q ci -m 11 | |
314 $ hg -q up 1 | |
315 $ echo 12 > foo | |
316 $ hg -q ci -m 12 | |
317 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
318 $ hg push -r 11 -r 12 ../f |
12279 | 319 pushing to ../f |
320 searching for changes | |
321 adding changesets | |
322 adding manifests | |
323 adding file changes | |
324 added 2 changesets with 2 changes to 1 files | |
325 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
326 |
12279 | 327 Failed push of new named branch: |
328 | |
329 $ echo 12 > foo | |
330 $ hg -q ci -m 12a | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
331 [1] |
12279 | 332 $ hg -q up 11 |
333 $ echo 13 > foo | |
334 $ hg -q branch e | |
335 $ 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
|
336 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
337 $ hg push -r 12 -r 13 ../f |
12279 | 338 pushing to ../f |
339 searching for changes | |
340 abort: push creates new remote branches: e! | |
341 (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
|
342 [255] |
12279 | 343 |
344 | |
345 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
|
346 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
347 $ hg push --new-branch -r 12 -r 13 ../f |
12279 | 348 pushing to ../f |
349 searching for changes | |
350 adding changesets | |
351 adding manifests | |
352 adding file changes | |
353 added 1 changesets with 1 changes to 1 files | |
354 | |
11211
e43c23d189a5
push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents:
10925
diff
changeset
|
355 |
12785
c7d23b4ca4ba
check-code: warning and fixes for whitespace in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12399
diff
changeset
|
356 Checking prepush logic does not allow silently pushing |
12279 | 357 multiple new heads: |
358 | |
359 $ cd .. | |
360 $ hg init h | |
361 $ echo init > h/init | |
362 $ hg -R h ci -Am init | |
363 adding init | |
364 $ echo a > h/a | |
365 $ hg -R h ci -Am a | |
366 adding a | |
367 $ hg clone h i | |
368 updating to branch default | |
369 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
370 $ hg -R h up 0 | |
371 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
372 $ echo b > h/b | |
373 $ hg -R h ci -Am b | |
374 adding b | |
375 created new head | |
376 $ hg -R i up 0 | |
377 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
378 $ echo c > i/c | |
379 $ hg -R i ci -Am c | |
380 adding c | |
381 created new head | |
9479
f3569d95c2ab
push: fix subtle bug in prepush logic
Sune Foldager <cryo@cyanite.org>
parents:
8565
diff
changeset
|
382 |
12279 | 383 $ hg -R i push h |
384 pushing to h | |
385 searching for changes | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
386 abort: push creates new remote head 97bd0c84d346! |
12279 | 387 (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
|
388 [255] |
12279 | 389 |
390 | |
391 Check prepush logic with merged branches: | |
392 | |
393 $ hg init j | |
394 $ hg -R j branch a | |
395 marked working directory as branch a | |
15615 | 396 (branches are permanent and global, did you want a bookmark?) |
12279 | 397 $ echo init > j/foo |
398 $ hg -R j ci -Am init | |
399 adding foo | |
400 $ hg clone j k | |
401 updating to branch a | |
402 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
403 $ echo a1 > j/foo | |
404 $ hg -R j ci -m a1 | |
405 $ hg -R k branch b | |
406 marked working directory as branch b | |
15615 | 407 (branches are permanent and global, did you want a bookmark?) |
12279 | 408 $ echo b > k/foo |
409 $ hg -R k ci -m b | |
410 $ hg -R k up 0 | |
411 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
412 | |
413 $ hg -R k merge b | |
414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
415 (branch merge, don't forget to commit) | |
416 | |
417 $ 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
|
418 |
12279 | 419 $ hg -R k push -r a j |
420 pushing to j | |
421 searching for changes | |
422 abort: push creates new remote branches: b! | |
423 (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
|
424 [255] |
12279 | 425 |
426 | |
427 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
|
428 |
12279 | 429 $ hg init l |
430 $ cd l | |
431 $ echo a >> foo | |
432 $ hg -q add foo | |
433 $ hg -q branch a | |
434 $ hg -q ci -ma | |
435 $ hg -q up null | |
436 $ echo a >> foo | |
437 $ hg -q add foo | |
438 $ hg -q branch b | |
439 $ hg -q ci -mb | |
440 $ cd .. | |
441 $ hg -q clone l m -u a | |
442 $ cd m | |
443 $ hg -q merge b | |
444 $ hg -q ci -mmb | |
445 $ hg -q up 0 | |
446 $ echo a >> foo | |
447 $ hg -q ci -ma2 | |
448 $ hg -q up 2 | |
449 $ echo a >> foo | |
450 $ hg -q branch -f b | |
451 $ hg -q ci -mb2 | |
452 $ hg -q merge 3 | |
453 $ hg -q ci -mma | |
454 | |
455 $ hg push ../l -b b | |
456 pushing to ../l | |
457 searching for changes | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
458 abort: push creates new remote head e7e31d71180f on branch 'a'! |
12279 | 459 (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
|
460 [255] |
12279 | 461 |
462 $ cd .. | |
463 | |
464 | |
465 Check prepush with new branch head on former topo non-head: | |
466 | |
467 $ hg init n | |
468 $ cd n | |
469 $ hg branch A | |
470 marked working directory as branch A | |
15615 | 471 (branches are permanent and global, did you want a bookmark?) |
12279 | 472 $ echo a >a |
473 $ hg ci -Ama | |
474 adding a | |
475 $ hg branch B | |
476 marked working directory as branch B | |
15615 | 477 (branches are permanent and global, did you want a bookmark?) |
12279 | 478 $ echo b >b |
479 $ hg ci -Amb | |
480 adding b | |
481 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
482 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
|
483 a is now branch head of A, but not a topological head |
12279 | 484 |
485 $ hg clone . inner | |
486 updating to branch B | |
487 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
488 $ cd inner | |
489 $ hg up B | |
490 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
491 $ echo b1 >b1 | |
492 $ hg ci -Amb1 | |
493 adding b1 | |
494 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
495 in the clone b1 is now the head of B |
12279 | 496 |
497 $ cd .. | |
498 $ hg up 0 | |
499 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
500 $ echo a2 >a2 | |
501 $ hg ci -Ama2 | |
502 adding a2 | |
503 | |
12785
c7d23b4ca4ba
check-code: warning and fixes for whitespace in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12399
diff
changeset
|
504 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
|
505 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
|
506 A, not B |
12279 | 507 |
508 glog of local: | |
509 | |
510 $ hg glog --template "{rev}: {branches} {desc}\n" | |
511 @ 2: A a2 | |
512 | | |
513 | o 1: B b | |
514 |/ | |
515 o 0: A a | |
516 | |
517 glog of remote: | |
518 | |
519 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
520 @ 2: B b1 | |
521 | | |
522 o 1: B b | |
523 | | |
524 o 0: A a | |
525 | |
526 outgoing: | |
527 | |
528 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
529 comparing with inner | |
530 searching for changes | |
531 2: A a2 | |
532 | |
533 $ hg push inner | |
534 pushing to inner | |
535 searching for changes | |
536 adding changesets | |
537 adding manifests | |
538 adding file changes | |
539 added 1 changesets with 1 changes to 1 files (+1 heads) | |
540 | |
541 $ cd .. | |
542 | |
543 | |
544 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
|
545 |
12279 | 546 $ hg init o |
547 $ cd o | |
548 $ hg branch A | |
549 marked working directory as branch A | |
15615 | 550 (branches are permanent and global, did you want a bookmark?) |
12279 | 551 $ echo a >a |
552 $ hg ci -Ama | |
553 adding a | |
554 $ hg branch B | |
555 marked working directory as branch B | |
15615 | 556 (branches are permanent and global, did you want a bookmark?) |
12279 | 557 $ echo b >b |
558 $ hg ci -Amb | |
559 adding b | |
560 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
561 b is now branch head of B, and a topological head |
12279 | 562 |
563 $ hg up 0 | |
564 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
565 $ echo a1 >a1 | |
566 $ hg ci -Ama1 | |
567 adding a1 | |
568 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
569 a1 is now branch head of A, and a topological head |
12279 | 570 |
571 $ hg clone . inner | |
572 updating to branch A | |
573 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
574 $ cd inner | |
575 $ hg up B | |
576 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
577 $ echo b1 >b1 | |
578 $ hg ci -Amb1 | |
579 adding b1 | |
580 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
581 in the clone b1 is now the head of B |
12279 | 582 |
583 $ cd .. | |
584 $ echo a2 >a2 | |
585 $ hg ci -Ama2 | |
586 adding a2 | |
587 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
588 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
|
589 it replaces a former topological and branch head, so this should not warn |
12279 | 590 |
591 glog of local: | |
592 | |
593 $ hg glog --template "{rev}: {branches} {desc}\n" | |
594 @ 3: A a2 | |
595 | | |
596 o 2: A a1 | |
597 | | |
598 | o 1: B b | |
599 |/ | |
600 o 0: A a | |
601 | |
602 glog of remote: | |
603 | |
604 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
605 @ 3: B b1 | |
606 | | |
607 | o 2: A a1 | |
608 | | | |
609 o | 1: B b | |
610 |/ | |
611 o 0: A a | |
612 | |
613 outgoing: | |
614 | |
615 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
616 comparing with inner | |
617 searching for changes | |
618 3: A a2 | |
619 | |
620 $ hg push inner | |
621 pushing to inner | |
622 searching for changes | |
623 adding changesets | |
624 adding manifests | |
625 adding file changes | |
626 added 1 changesets with 1 changes to 1 files | |
627 | |
628 $ cd .. | |
629 | |
630 | |
631 Check prepush with new branch head and new child of former branch head | |
632 but child is on different branch: | |
633 | |
634 $ hg init p | |
635 $ cd p | |
636 $ hg branch A | |
637 marked working directory as branch A | |
15615 | 638 (branches are permanent and global, did you want a bookmark?) |
12279 | 639 $ echo a0 >a |
640 $ hg ci -Ama0 | |
641 adding a | |
642 $ echo a1 >a | |
643 $ hg ci -ma1 | |
644 $ hg up null | |
645 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
646 $ hg branch B | |
647 marked working directory as branch B | |
15615 | 648 (branches are permanent and global, did you want a bookmark?) |
12279 | 649 $ echo b0 >b |
650 $ hg ci -Amb0 | |
651 adding b | |
652 $ echo b1 >b | |
653 $ hg ci -mb1 | |
654 | |
655 $ hg clone . inner | |
656 updating to branch B | |
657 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
|
658 |
12279 | 659 $ hg up A |
660 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
661 $ hg branch -f B | |
662 marked working directory as branch B | |
15615 | 663 (branches are permanent and global, did you want a bookmark?) |
12279 | 664 $ echo a3 >a |
665 $ hg ci -ma3 | |
666 created new head | |
667 $ hg up 3 | |
668 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
669 $ hg branch -f A | |
670 marked working directory as branch A | |
15615 | 671 (branches are permanent and global, did you want a bookmark?) |
12279 | 672 $ echo b3 >b |
673 $ hg ci -mb3 | |
674 created new head | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
675 |
12279 | 676 glog of local: |
677 | |
678 $ hg glog --template "{rev}: {branches} {desc}\n" | |
679 @ 5: A b3 | |
680 | | |
681 | o 4: B a3 | |
682 | | | |
683 o | 3: B b1 | |
684 | | | |
685 o | 2: B b0 | |
686 / | |
687 o 1: A a1 | |
688 | | |
689 o 0: A a0 | |
690 | |
691 glog of remote: | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
692 |
12279 | 693 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" |
694 @ 3: B b1 | |
695 | | |
696 o 2: B b0 | |
697 | |
698 o 1: A a1 | |
699 | | |
700 o 0: A a0 | |
701 | |
702 outgoing: | |
703 | |
704 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
705 comparing with inner | |
706 searching for changes | |
707 4: B a3 | |
708 5: A b3 | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
709 |
12279 | 710 $ hg push inner |
711 pushing to inner | |
712 searching for changes | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
713 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'! |
12279 | 714 (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
|
715 [255] |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
716 |
12279 | 717 $ hg push inner -r4 -r5 |
718 pushing to inner | |
719 searching for changes | |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
720 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'! |
12279 | 721 (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
|
722 [255] |
12279 | 723 |
724 $ hg in inner | |
725 comparing with inner | |
726 searching for changes | |
727 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
728 [1] |