Mercurial > hg
annotate tests/test-push-warn.t @ 25913:fa14ba7b9667
wireproto: make wirepeer look-before-you-leap on batching
This means that users of request batching don't need to worry
themselves with capability checking. Instead, they can just use
batching, and if the remote server doesn't support batching for some
reason the wirepeer code will transparently un-batch the requests.
This will allow for some slight simplification in a handful of
places. Prior to this change, largefiles would have been silently
broken against a server which did not support batching.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 05 Aug 2015 14:15:17 -0400 |
parents | a76f9fc18ebd |
children | 12f727a5b434 |
rev | line source |
---|---|
25353
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
1 $ cat << EOF >> $HGRCPATH |
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
2 > [experimental] |
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
3 > # drop me once bundle2 is the default, |
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
4 > # added to get test change early. |
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
5 > bundle2-exp = True |
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
6 > EOF |
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
13550
diff
changeset
|
7 $ hg init a |
12279 | 8 $ cd a |
9 $ echo foo > t1 | |
10 $ hg add t1 | |
11 $ hg commit -m "1" | |
10875
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
12 |
12279 | 13 $ cd .. |
14 $ hg clone a b | |
15 updating to branch default | |
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
17 | |
18 $ cd a | |
19 $ echo foo > t2 | |
20 $ hg add t2 | |
21 $ hg commit -m "2" | |
22 | |
23 $ cd ../b | |
24 $ echo foo > t3 | |
25 $ hg add t3 | |
26 $ hg commit -m "3" | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
27 |
24429
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
28 Specifying a revset that evaluates to null will abort |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
29 |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
30 $ hg push -r '0 & 1' ../a |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
31 pushing to ../a |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
32 abort: specified revisions evaluate to an empty set |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
33 (use different revision arguments) |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
34 [255] |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
35 |
12279 | 36 $ hg push ../a |
37 pushing to ../a | |
38 searching for changes | |
20501
8a9e0b523d2d
discovery: improve "note: unsynced remote changes!" warning
Mads Kiilerich <madski@unity3d.com>
parents:
20117
diff
changeset
|
39 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
40 abort: push creates new remote head 1e108cc5548c! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
41 (pull and merge or see "hg help push" for details about pushing new heads) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
42 [255] |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
43 |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
44 $ hg push --debug ../a |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
45 pushing to ../a |
14164
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
46 query 1; heads |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
47 searching for changes |
14164
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
48 taking quick initial sample |
14624
f03c82d1f50a
setdiscovery: batch heads and known(ownheads)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14526
diff
changeset
|
49 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
|
50 2 total queries |
22019
9fcf772f15ff
push: perform phases discovery before the push
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
21198
diff
changeset
|
51 listing keys for "phases" |
22239
0688010ee38f
push: move bookmark discovery with other discovery steps
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
22019
diff
changeset
|
52 checking for updated bookmarks |
0688010ee38f
push: move bookmark discovery with other discovery steps
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
22019
diff
changeset
|
53 listing keys for "bookmarks" |
17293
d3f84ccc5495
pushkey: add more verbose debug output regarding pushkey
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
16913
diff
changeset
|
54 listing keys for "bookmarks" |
20501
8a9e0b523d2d
discovery: improve "note: unsynced remote changes!" warning
Mads Kiilerich <madski@unity3d.com>
parents:
20117
diff
changeset
|
55 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a |
20051
b988b3b19303
discovery: make note messages for new heads more readable
Mads Kiilerich <madski@unity3d.com>
parents:
20050
diff
changeset
|
56 new remote heads on branch 'default': |
b988b3b19303
discovery: make note messages for new heads more readable
Mads Kiilerich <madski@unity3d.com>
parents:
20050
diff
changeset
|
57 1e108cc5548c |
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! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
59 (pull and merge or see "hg help push" for details about pushing new heads) |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
60 [255] |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
61 |
12279 | 62 $ hg pull ../a |
63 pulling from ../a | |
64 searching for changes | |
65 adding changesets | |
66 adding manifests | |
67 adding file changes | |
68 added 1 changesets with 1 changes to 1 files (+1 heads) | |
69 (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
|
70 |
12279 | 71 $ hg push ../a |
72 pushing to ../a | |
73 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
|
74 abort: push creates new remote head 1e108cc5548c! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
75 (merge or see "hg help push" for details about pushing new heads) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
76 [255] |
12279 | 77 |
78 $ hg merge | |
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
80 (branch merge, don't forget to commit) | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
81 |
12279 | 82 $ hg commit -m "4" |
83 $ hg push ../a | |
84 pushing to ../a | |
85 searching for changes | |
86 adding changesets | |
87 adding manifests | |
88 adding file changes | |
89 added 2 changesets with 1 changes to 1 files | |
90 | |
91 $ cd .. | |
92 | |
93 $ hg init c | |
94 $ cd c | |
95 $ for i in 0 1 2; do | |
96 > echo $i >> foo | |
97 > hg ci -Am $i | |
98 > done | |
99 adding foo | |
100 $ cd .. | |
101 | |
102 $ hg clone c d | |
103 updating to branch default | |
104 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
|
105 |
12279 | 106 $ cd d |
107 $ for i in 0 1; do | |
108 > hg co -C $i | |
109 > echo d-$i >> foo | |
110 > hg ci -m d-$i | |
111 > done | |
112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
113 created new head | |
114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
115 created new head | |
116 | |
117 $ HGMERGE=true hg merge 3 | |
118 merging foo | |
119 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
120 (branch merge, don't forget to commit) | |
121 | |
122 $ 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
|
123 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
124 $ hg push ../c |
12279 | 125 pushing to ../c |
126 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
|
127 abort: push creates new remote head 6346d66eb9f5! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
128 (merge or see "hg help push" for details about pushing new heads) |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
129 [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
|
130 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
131 $ hg push -r 2 ../c |
12279 | 132 pushing to ../c |
133 searching for changes | |
134 no changes found | |
16023
90f8b8dd0326
push: return 1 if no changes found (issue3228)
Matt Mackall <mpm@selenic.com>
parents:
15615
diff
changeset
|
135 [1] |
12279 | 136 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
137 $ hg push -r 3 ../c |
12279 | 138 pushing to ../c |
139 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
|
140 abort: push creates new remote head a5dda829a167! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
141 (merge or see "hg help push" for details about pushing new heads) |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
142 [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
|
143 |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
144 $ hg push -v -r 3 -r 4 ../c |
12279 | 145 pushing to ../c |
146 searching for changes | |
20051
b988b3b19303
discovery: make note messages for new heads more readable
Mads Kiilerich <madski@unity3d.com>
parents:
20050
diff
changeset
|
147 new remote heads on branch 'default': |
b988b3b19303
discovery: make note messages for new heads more readable
Mads Kiilerich <madski@unity3d.com>
parents:
20050
diff
changeset
|
148 a5dda829a167 |
b988b3b19303
discovery: make note messages for new heads more readable
Mads Kiilerich <madski@unity3d.com>
parents:
20050
diff
changeset
|
149 ee8fbc7a0295 |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
150 abort: push creates new remote head a5dda829a167! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
151 (merge or see "hg help push" for details about pushing new heads) |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
152 [255] |
12279 | 153 |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
154 $ hg push -v -f -r 3 -r 4 ../c |
12279 | 155 pushing to ../c |
156 searching for changes | |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
157 2 changesets found |
23748
4ab66de46a96
bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents:
22239
diff
changeset
|
158 uncompressed size of bundle content: |
25353
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
159 348 (changelog) |
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
160 326 (manifests) |
a76f9fc18ebd
test: use bundle2 for exchange in test-push-warn
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25295
diff
changeset
|
161 253 foo |
12279 | 162 adding changesets |
163 adding manifests | |
164 adding file changes | |
165 added 2 changesets with 2 changes to 1 files (+2 heads) | |
166 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
167 $ hg push -r 5 ../c |
12279 | 168 pushing to ../c |
169 searching for changes | |
170 adding changesets | |
171 adding manifests | |
172 adding file changes | |
173 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
|
174 |
12279 | 175 $ hg in ../c |
176 comparing with ../c | |
177 searching for changes | |
178 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
179 [1] |
12279 | 180 |
181 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
182 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
|
183 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
|
184 |
12279 | 185 $ hg init ../e |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
186 $ hg push -r 0 ../e |
12279 | 187 pushing to ../e |
188 searching for changes | |
189 adding changesets | |
190 adding manifests | |
191 adding file changes | |
192 added 1 changesets with 1 changes to 1 files | |
193 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
194 $ hg push -r 1 ../e |
12279 | 195 pushing to ../e |
196 searching for changes | |
197 adding changesets | |
198 adding manifests | |
199 adding file changes | |
200 added 1 changesets with 1 changes to 1 files | |
201 | |
202 $ cd .. | |
203 | |
204 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
205 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
|
206 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
|
207 |
12279 | 208 $ hg init f |
209 $ cd f | |
210 $ hg -q branch a | |
211 $ echo 0 > foo | |
212 $ hg -q ci -Am 0 | |
213 $ echo 1 > foo | |
214 $ hg -q ci -m 1 | |
215 $ hg -q up 0 | |
216 $ echo 2 > foo | |
217 $ hg -q ci -m 2 | |
218 $ hg -q up 0 | |
219 $ hg -q branch b | |
220 $ echo 3 > foo | |
221 $ hg -q ci -m 3 | |
222 $ cd .. | |
223 | |
224 $ hg -q clone f g | |
225 $ cd g | |
226 | |
227 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
|
228 |
12279 | 229 $ hg -q up 1 |
230 $ echo 4 > foo | |
231 $ hg -q ci -m 4 | |
232 $ hg -q up 0 | |
233 $ echo 5 > foo | |
234 $ hg -q branch c | |
235 $ hg -q ci -m 5 | |
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! | |
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] |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
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 5 ../f |
12279 | 245 pushing to ../f |
246 searching for changes | |
247 abort: push creates new remote branches: c! | |
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 | |
252 Multiple new branches: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
253 |
12279 | 254 $ hg -q branch d |
255 $ echo 6 > foo | |
256 $ hg -q ci -m 6 | |
257 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
258 $ hg push ../f |
12279 | 259 pushing to ../f |
260 searching for changes | |
261 abort: push creates new remote branches: c, d! | |
262 (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
|
263 [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
|
264 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
265 $ hg push -r 4 -r 6 ../f |
12279 | 266 pushing to ../f |
267 searching for changes | |
268 abort: push creates new remote branches: c, d! | |
269 (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
|
270 [255] |
12279 | 271 |
272 $ cd ../g | |
273 | |
274 | |
275 Fail on multiple head push: | |
276 | |
277 $ hg -q up 1 | |
278 $ echo 7 > foo | |
279 $ hg -q ci -m 7 | |
280 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
281 $ hg push -r 4 -r 7 ../f |
12279 | 282 pushing to ../f |
283 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
|
284 abort: push creates new remote head 0b715ef6ff8f on branch 'a'! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
285 (merge or see "hg help push" for details about pushing new heads) |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
286 [255] |
12279 | 287 |
288 Push replacement head on existing branches: | |
289 | |
290 $ hg -q up 3 | |
291 $ echo 8 > foo | |
292 $ 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
|
293 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
294 $ hg push -r 7 -r 8 ../f |
12279 | 295 pushing to ../f |
296 searching for changes | |
297 adding changesets | |
298 adding manifests | |
299 adding file changes | |
300 added 2 changesets with 2 changes to 1 files | |
301 | |
302 | |
303 Merge of branch a to other branch b followed by unrelated push | |
304 on branch a: | |
305 | |
306 $ hg -q up 7 | |
307 $ HGMERGE=true hg -q merge 8 | |
308 $ hg -q ci -m 9 | |
309 $ hg -q up 8 | |
310 $ echo 10 > foo | |
311 $ hg -q ci -m 10 | |
312 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
313 $ hg push -r 9 ../f |
12279 | 314 pushing to ../f |
315 searching for changes | |
316 adding changesets | |
317 adding manifests | |
318 adding file changes | |
319 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
|
320 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
321 $ hg push -r 10 ../f |
12279 | 322 pushing to ../f |
323 searching for changes | |
324 adding changesets | |
325 adding manifests | |
326 adding file changes | |
327 added 1 changesets with 1 changes to 1 files (+1 heads) | |
328 | |
329 | |
330 Cheating the counting algorithm: | |
331 | |
332 $ hg -q up 9 | |
333 $ HGMERGE=true hg -q merge 2 | |
334 $ hg -q ci -m 11 | |
335 $ hg -q up 1 | |
336 $ echo 12 > foo | |
337 $ hg -q ci -m 12 | |
338 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
339 $ hg push -r 11 -r 12 ../f |
12279 | 340 pushing to ../f |
341 searching for changes | |
342 adding changesets | |
343 adding manifests | |
344 adding file changes | |
345 added 2 changesets with 2 changes to 1 files | |
346 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
347 |
12279 | 348 Failed push of new named branch: |
349 | |
350 $ echo 12 > foo | |
351 $ hg -q ci -m 12a | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
352 [1] |
12279 | 353 $ hg -q up 11 |
354 $ echo 13 > foo | |
355 $ hg -q branch e | |
356 $ 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
|
357 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
358 $ hg push -r 12 -r 13 ../f |
12279 | 359 pushing to ../f |
360 searching for changes | |
361 abort: push creates new remote branches: e! | |
362 (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
|
363 [255] |
12279 | 364 |
365 | |
366 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
|
367 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
368 $ hg push --new-branch -r 12 -r 13 ../f |
12279 | 369 pushing to ../f |
370 searching for changes | |
371 adding changesets | |
372 adding manifests | |
373 adding file changes | |
374 added 1 changesets with 1 changes to 1 files | |
375 | |
21024
7731a2281cf0
spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents:
20501
diff
changeset
|
376 Pushing multi headed new branch: |
19840
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
377 |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
378 $ echo 14 > foo |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
379 $ hg -q branch f |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
380 $ hg -q ci -m 14 |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
381 $ echo 15 > foo |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
382 $ hg -q ci -m 15 |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
383 $ hg -q up 14 |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
384 $ echo 16 > foo |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
385 $ hg -q ci -m 16 |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
386 $ hg push --branch f --new-branch ../f |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
387 pushing to ../f |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
388 searching for changes |
20050
877e05b46509
discovery: tweak error message for multiple branch heads
Mads Kiilerich <madski@unity3d.com>
parents:
19936
diff
changeset
|
389 abort: push creates new branch 'f' with multiple heads |
19936
8179eb28983b
discovery: revise hint message introduced by changeset b00ba31313c3
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19934
diff
changeset
|
390 (merge or see "hg help push" for details about pushing new heads) |
19840
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
391 [255] |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
392 $ hg push --branch f --new-branch --force ../f |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
393 pushing to ../f |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
394 searching for changes |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
395 adding changesets |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
396 adding manifests |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
397 adding file changes |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
398 added 3 changesets with 3 changes to 1 files (+1 heads) |
11211
e43c23d189a5
push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents:
10925
diff
changeset
|
399 |
12785
c7d23b4ca4ba
check-code: warning and fixes for whitespace in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12399
diff
changeset
|
400 Checking prepush logic does not allow silently pushing |
21198
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
401 multiple new heads but also doesn't report too many heads: |
12279 | 402 |
403 $ cd .. | |
404 $ hg init h | |
405 $ echo init > h/init | |
406 $ hg -R h ci -Am init | |
407 adding init | |
408 $ echo a > h/a | |
409 $ hg -R h ci -Am a | |
410 adding a | |
411 $ hg clone h i | |
412 updating to branch default | |
413 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
414 $ hg -R h up 0 | |
415 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
416 $ echo b > h/b | |
417 $ hg -R h ci -Am b | |
418 adding b | |
419 created new head | |
420 $ hg -R i up 0 | |
421 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
422 $ echo c > i/c | |
423 $ hg -R i ci -Am c | |
424 adding c | |
425 created new head | |
9479
f3569d95c2ab
push: fix subtle bug in prepush logic
Sune Foldager <cryo@cyanite.org>
parents:
8565
diff
changeset
|
426 |
24361
8de8cd34f2e3
tests: replace uses of 'seq' with portable 'seq.py'
Matt Harbison <matt_harbison@yahoo.com>
parents:
23748
diff
changeset
|
427 $ for i in `python $TESTDIR/seq.py 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done |
21198
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
428 |
12279 | 429 $ hg -R i push h |
430 pushing to h | |
431 searching for changes | |
21198
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
432 remote has heads on branch 'default' that are not known locally: 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847 |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
433 abort: push creates new remote head 97bd0c84d346! |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
434 (pull and merge or see "hg help push" for details about pushing new heads) |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
435 [255] |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
436 $ hg -R h up -q 0; echo x > h/b; hg -R h ci -qAmx |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
437 $ hg -R i push h |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
438 pushing to h |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
439 searching for changes |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
440 remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 and 1 others |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
441 abort: push creates new remote head 97bd0c84d346! |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
442 (pull and merge or see "hg help push" for details about pushing new heads) |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
443 [255] |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
444 $ hg -R i push h -v |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
445 pushing to h |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
446 searching for changes |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
447 remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847 |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
448 new remote heads on branch 'default': |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
449 97bd0c84d346 |
14525
826a13720fbc
prepush: print short hash of first new head in abort message
Adrian Buehlmann <adrian@cadifra.com>
parents:
14164
diff
changeset
|
450 abort: push creates new remote head 97bd0c84d346! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
451 (pull and merge or see "hg help push" for details about pushing new heads) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
452 [255] |
12279 | 453 |
454 | |
455 Check prepush logic with merged branches: | |
456 | |
457 $ hg init j | |
458 $ hg -R j branch a | |
459 marked working directory as branch a | |
15615 | 460 (branches are permanent and global, did you want a bookmark?) |
12279 | 461 $ echo init > j/foo |
462 $ hg -R j ci -Am init | |
463 adding foo | |
464 $ hg clone j k | |
465 updating to branch a | |
466 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
467 $ echo a1 > j/foo | |
468 $ hg -R j ci -m a1 | |
469 $ hg -R k branch b | |
470 marked working directory as branch b | |
471 $ echo b > k/foo | |
472 $ hg -R k ci -m b | |
473 $ hg -R k up 0 | |
474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
475 | |
476 $ hg -R k merge b | |
477 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
478 (branch merge, don't forget to commit) | |
479 | |
480 $ 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
|
481 |
12279 | 482 $ hg -R k push -r a j |
483 pushing to j | |
484 searching for changes | |
485 abort: push creates new remote branches: b! | |
486 (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
|
487 [255] |
12279 | 488 |
489 | |
490 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
|
491 |
12279 | 492 $ hg init l |
493 $ cd l | |
494 $ echo a >> foo | |
495 $ hg -q add foo | |
496 $ hg -q branch a | |
497 $ hg -q ci -ma | |
498 $ hg -q up null | |
499 $ echo a >> foo | |
500 $ hg -q add foo | |
501 $ hg -q branch b | |
502 $ hg -q ci -mb | |
503 $ cd .. | |
504 $ hg -q clone l m -u a | |
505 $ cd m | |
506 $ hg -q merge b | |
507 $ hg -q ci -mmb | |
508 $ hg -q up 0 | |
509 $ echo a >> foo | |
510 $ hg -q ci -ma2 | |
511 $ hg -q up 2 | |
512 $ echo a >> foo | |
513 $ hg -q branch -f b | |
514 $ hg -q ci -mb2 | |
515 $ hg -q merge 3 | |
516 $ hg -q ci -mma | |
517 | |
518 $ hg push ../l -b b | |
519 pushing to ../l | |
520 searching for changes | |
18361
06f075836010
discovery: process heads in sorted order
Mads Kiilerich <mads@kiilerich.com>
parents:
17293
diff
changeset
|
521 abort: push creates new remote head 451211cc22b0 on branch 'a'! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
522 (merge or see "hg help push" for details about pushing new heads) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
523 [255] |
12279 | 524 |
525 $ cd .. | |
526 | |
527 | |
528 Check prepush with new branch head on former topo non-head: | |
529 | |
530 $ hg init n | |
531 $ cd n | |
532 $ hg branch A | |
533 marked working directory as branch A | |
15615 | 534 (branches are permanent and global, did you want a bookmark?) |
12279 | 535 $ echo a >a |
536 $ hg ci -Ama | |
537 adding a | |
538 $ hg branch B | |
539 marked working directory as branch B | |
540 $ echo b >b | |
541 $ hg ci -Amb | |
542 adding b | |
543 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
544 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
|
545 a is now branch head of A, but not a topological head |
12279 | 546 |
547 $ hg clone . inner | |
548 updating to branch B | |
549 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
550 $ cd inner | |
551 $ hg up B | |
552 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
553 $ echo b1 >b1 | |
554 $ hg ci -Amb1 | |
555 adding b1 | |
556 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
557 in the clone b1 is now the head of B |
12279 | 558 |
559 $ cd .. | |
560 $ hg up 0 | |
561 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
562 $ echo a2 >a2 | |
563 $ hg ci -Ama2 | |
564 adding a2 | |
565 | |
12785
c7d23b4ca4ba
check-code: warning and fixes for whitespace in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12399
diff
changeset
|
566 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
|
567 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
|
568 A, not B |
12279 | 569 |
570 glog of local: | |
571 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
572 $ hg log -G --template "{rev}: {branches} {desc}\n" |
12279 | 573 @ 2: A a2 |
574 | | |
575 | o 1: B b | |
576 |/ | |
577 o 0: A a | |
578 | |
579 glog of remote: | |
580 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
581 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n" |
12279 | 582 @ 2: B b1 |
583 | | |
584 o 1: B b | |
585 | | |
586 o 0: A a | |
587 | |
588 outgoing: | |
589 | |
590 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
591 comparing with inner | |
592 searching for changes | |
593 2: A a2 | |
594 | |
595 $ hg push inner | |
596 pushing to inner | |
597 searching for changes | |
598 adding changesets | |
599 adding manifests | |
600 adding file changes | |
601 added 1 changesets with 1 changes to 1 files (+1 heads) | |
602 | |
603 $ cd .. | |
604 | |
605 | |
606 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
|
607 |
12279 | 608 $ hg init o |
609 $ cd o | |
610 $ hg branch A | |
611 marked working directory as branch A | |
15615 | 612 (branches are permanent and global, did you want a bookmark?) |
12279 | 613 $ echo a >a |
614 $ hg ci -Ama | |
615 adding a | |
616 $ hg branch B | |
617 marked working directory as branch B | |
618 $ echo b >b | |
619 $ hg ci -Amb | |
620 adding b | |
621 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
622 b is now branch head of B, and a topological head |
12279 | 623 |
624 $ hg up 0 | |
625 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
626 $ echo a1 >a1 | |
627 $ hg ci -Ama1 | |
628 adding a1 | |
629 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
630 a1 is now branch head of A, and a topological head |
12279 | 631 |
632 $ hg clone . inner | |
633 updating to branch A | |
634 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
635 $ cd inner | |
636 $ hg up B | |
637 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
638 $ echo b1 >b1 | |
639 $ hg ci -Amb1 | |
640 adding b1 | |
641 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
642 in the clone b1 is now the head of B |
12279 | 643 |
644 $ cd .. | |
645 $ echo a2 >a2 | |
646 $ hg ci -Ama2 | |
647 adding a2 | |
648 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
649 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
|
650 it replaces a former topological and branch head, so this should not warn |
12279 | 651 |
652 glog of local: | |
653 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
654 $ hg log -G --template "{rev}: {branches} {desc}\n" |
12279 | 655 @ 3: A a2 |
656 | | |
657 o 2: A a1 | |
658 | | |
659 | o 1: B b | |
660 |/ | |
661 o 0: A a | |
662 | |
663 glog of remote: | |
664 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
665 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n" |
12279 | 666 @ 3: B b1 |
667 | | |
668 | o 2: A a1 | |
669 | | | |
670 o | 1: B b | |
671 |/ | |
672 o 0: A a | |
673 | |
674 outgoing: | |
675 | |
676 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
677 comparing with inner | |
678 searching for changes | |
679 3: A a2 | |
680 | |
681 $ hg push inner | |
682 pushing to inner | |
683 searching for changes | |
684 adding changesets | |
685 adding manifests | |
686 adding file changes | |
687 added 1 changesets with 1 changes to 1 files | |
688 | |
689 $ cd .. | |
690 | |
691 | |
692 Check prepush with new branch head and new child of former branch head | |
693 but child is on different branch: | |
694 | |
695 $ hg init p | |
696 $ cd p | |
697 $ hg branch A | |
698 marked working directory as branch A | |
15615 | 699 (branches are permanent and global, did you want a bookmark?) |
12279 | 700 $ echo a0 >a |
701 $ hg ci -Ama0 | |
702 adding a | |
703 $ echo a1 >a | |
704 $ hg ci -ma1 | |
705 $ hg up null | |
706 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
707 $ hg branch B | |
708 marked working directory as branch B | |
709 $ echo b0 >b | |
710 $ hg ci -Amb0 | |
711 adding b | |
712 $ echo b1 >b | |
713 $ hg ci -mb1 | |
714 | |
715 $ hg clone . inner | |
716 updating to branch B | |
717 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
|
718 |
12279 | 719 $ hg up A |
720 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
721 $ hg branch -f B | |
722 marked working directory as branch B | |
723 $ echo a3 >a | |
724 $ hg ci -ma3 | |
725 created new head | |
726 $ hg up 3 | |
727 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
728 $ hg branch -f A | |
729 marked working directory as branch A | |
730 $ echo b3 >b | |
731 $ hg ci -mb3 | |
732 created new head | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
733 |
12279 | 734 glog of local: |
735 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
736 $ hg log -G --template "{rev}: {branches} {desc}\n" |
12279 | 737 @ 5: A b3 |
738 | | |
739 | o 4: B a3 | |
740 | | | |
741 o | 3: B b1 | |
742 | | | |
743 o | 2: B b0 | |
744 / | |
745 o 1: A a1 | |
746 | | |
747 o 0: A a0 | |
748 | |
749 glog of remote: | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
750 |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
751 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n" |
12279 | 752 @ 3: B b1 |
753 | | |
754 o 2: B b0 | |
755 | |
756 o 1: A a1 | |
757 | | |
758 o 0: A a0 | |
759 | |
760 outgoing: | |
761 | |
762 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
763 comparing with inner | |
764 searching for changes | |
765 4: B a3 | |
766 5: A b3 | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
767 |
12279 | 768 $ hg push inner |
769 pushing to inner | |
770 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
|
771 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
772 (merge or see "hg help push" for details about pushing new heads) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
773 [255] |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
774 |
12279 | 775 $ hg push inner -r4 -r5 |
776 pushing to inner | |
777 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
|
778 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'! |
19934
bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19840
diff
changeset
|
779 (merge or see "hg help push" for details about pushing new heads) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
780 [255] |
12279 | 781 |
782 $ hg in inner | |
783 comparing with inner | |
784 searching for changes | |
785 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
786 [1] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16023
diff
changeset
|
787 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16023
diff
changeset
|
788 $ cd .. |