Mercurial > hg
annotate tests/test-push-warn.t @ 48948:4bb04a506af6
revlog: remove unused `rank` variable from D12209
Differential Revision: https://phab.mercurial-scm.org/D12355
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 04 Mar 2022 13:01:13 -0800 |
parents | 9261f6c1d39b |
children | 2cf264e9aa75 |
rev | line source |
---|---|
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
13550
diff
changeset
|
1 $ hg init a |
12279 | 2 $ cd a |
3 $ echo foo > t1 | |
4 $ hg add t1 | |
5 $ hg commit -m "1" | |
10875
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
6 |
12279 | 7 $ cd .. |
8 $ hg clone a b | |
9 updating to branch default | |
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
11 | |
12 $ cd a | |
13 $ echo foo > t2 | |
14 $ hg add t2 | |
15 $ hg commit -m "2" | |
16 | |
17 $ cd ../b | |
18 $ echo foo > t3 | |
19 $ hg add t3 | |
20 $ hg commit -m "3" | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
21 |
24429
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
22 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
|
23 |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
24 $ 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
|
25 pushing to ../a |
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
26 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
|
27 (use different revision arguments) |
45827
8d72e29ad1e0
errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents:
42203
diff
changeset
|
28 [10] |
24429
69bd0ec2f9be
commands.push: abort when revisions evaluate to empty set (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24361
diff
changeset
|
29 |
12279 | 30 $ hg push ../a |
31 pushing to ../a | |
32 searching for changes | |
20501
8a9e0b523d2d
discovery: improve "note: unsynced remote changes!" warning
Mads Kiilerich <madski@unity3d.com>
parents:
20117
diff
changeset
|
33 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
34 abort: push creates new remote head 1e108cc5548c |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
35 (pull and merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
36 [20] |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
37 |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
38 $ hg push --debug ../a |
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
39 pushing to ../a |
14164
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
40 query 1; heads |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
41 searching for changes |
14164
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14073
diff
changeset
|
42 taking quick initial sample |
14624
f03c82d1f50a
setdiscovery: batch heads and known(ownheads)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14526
diff
changeset
|
43 query 2; still undecided: 1, sample size is: 1 |
32712
43bda143e3b2
discovery: include timing in the debug output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
30211
diff
changeset
|
44 2 total queries in *.????s (glob) |
22019
9fcf772f15ff
push: perform phases discovery before the push
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
21198
diff
changeset
|
45 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
|
46 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
|
47 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
|
48 listing keys for "bookmarks" |
20501
8a9e0b523d2d
discovery: improve "note: unsynced remote changes!" warning
Mads Kiilerich <madski@unity3d.com>
parents:
20117
diff
changeset
|
49 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
|
50 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
|
51 1e108cc5548c |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
52 abort: push creates new remote head 1e108cc5548c |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
53 (pull and merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
54 [20] |
12998
91cb08a9e7fb
discovery: list new remote heads in prepush() on --debug
Adrian Buehlmann <adrian@cadifra.com>
parents:
12785
diff
changeset
|
55 |
12279 | 56 $ hg pull ../a |
57 pulling from ../a | |
58 searching for changes | |
59 adding changesets | |
60 adding manifests | |
61 adding file changes | |
62 added 1 changesets with 1 changes to 1 files (+1 heads) | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
32940
diff
changeset
|
63 new changesets 1c9246a22a0a |
12279 | 64 (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
|
65 |
12279 | 66 $ hg push ../a |
67 pushing to ../a | |
68 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
69 abort: push creates new remote head 1e108cc5548c |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
70 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
71 [20] |
12279 | 72 |
73 $ hg merge | |
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
75 (branch merge, don't forget to commit) | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
76 |
12279 | 77 $ hg commit -m "4" |
78 $ hg push ../a | |
79 pushing to ../a | |
80 searching for changes | |
81 adding changesets | |
82 adding manifests | |
83 adding file changes | |
84 added 2 changesets with 1 changes to 1 files | |
85 | |
86 $ cd .. | |
87 | |
88 $ hg init c | |
89 $ cd c | |
90 $ for i in 0 1 2; do | |
91 > echo $i >> foo | |
92 > hg ci -Am $i | |
93 > done | |
94 adding foo | |
95 $ cd .. | |
96 | |
97 $ hg clone c d | |
98 updating to branch default | |
99 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
|
100 |
12279 | 101 $ cd d |
102 $ for i in 0 1; do | |
103 > hg co -C $i | |
104 > echo d-$i >> foo | |
105 > hg ci -m d-$i | |
106 > done | |
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
108 created new head | |
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
110 created new head | |
111 | |
112 $ HGMERGE=true hg merge 3 | |
113 merging foo | |
114 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
115 (branch merge, don't forget to commit) | |
116 | |
117 $ 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
|
118 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
119 $ hg push ../c |
12279 | 120 pushing to ../c |
121 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
122 abort: push creates new remote head 6346d66eb9f5 |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
123 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
124 [20] |
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
|
125 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
126 $ hg push -r 2 ../c |
12279 | 127 pushing to ../c |
128 searching for changes | |
129 no changes found | |
16023
90f8b8dd0326
push: return 1 if no changes found (issue3228)
Matt Mackall <mpm@selenic.com>
parents:
15615
diff
changeset
|
130 [1] |
12279 | 131 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
132 $ hg push -r 3 ../c |
12279 | 133 pushing to ../c |
134 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
135 abort: push creates new remote head a5dda829a167 |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
136 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
137 [20] |
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
|
138 |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
139 $ hg push -v -r 3 -r 4 ../c |
12279 | 140 pushing to ../c |
141 searching for changes | |
20051
b988b3b19303
discovery: make note messages for new heads more readable
Mads Kiilerich <madski@unity3d.com>
parents:
20050
diff
changeset
|
142 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
|
143 a5dda829a167 |
b988b3b19303
discovery: make note messages for new heads more readable
Mads Kiilerich <madski@unity3d.com>
parents:
20050
diff
changeset
|
144 ee8fbc7a0295 |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
145 abort: push creates new remote head a5dda829a167 |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
146 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
147 [20] |
12279 | 148 |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
149 $ hg push -v -f -r 3 -r 4 ../c |
12279 | 150 pushing to ../c |
151 searching for changes | |
14526
4276e3202585
prepush: show details about new remote heads with --verbose
Adrian Buehlmann <adrian@cadifra.com>
parents:
14525
diff
changeset
|
152 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
|
153 uncompressed size of bundle content: |
30211
6b0741d6d234
changegroup: skip delta when the underlying revlog do not use them
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
29973
diff
changeset
|
154 352 (changelog) |
27752
29cfc474c5fd
changegroup3: introduce experimental.changegroup3 boolean config
Martin von Zweigbergk <martinvonz@google.com>
parents:
27433
diff
changeset
|
155 326 (manifests) |
37338
cbc4425e81b5
tests: conditionalize tests based on presence of revlogs for files
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34661
diff
changeset
|
156 25\d foo (re) |
12279 | 157 adding changesets |
158 adding manifests | |
159 adding file changes | |
160 added 2 changesets with 2 changes to 1 files (+2 heads) | |
161 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
162 $ hg push -r 5 ../c |
12279 | 163 pushing to ../c |
164 searching for changes | |
165 adding changesets | |
166 adding manifests | |
167 adding file changes | |
168 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
|
169 |
12279 | 170 $ hg in ../c |
171 comparing with ../c | |
172 searching for changes | |
173 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
174 [1] |
12279 | 175 |
176 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
177 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
|
178 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
|
179 |
12279 | 180 $ hg init ../e |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
181 $ hg push -r 0 ../e |
12279 | 182 pushing to ../e |
183 searching for changes | |
184 adding changesets | |
185 adding manifests | |
186 adding file changes | |
187 added 1 changesets with 1 changes to 1 files | |
188 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
189 $ hg push -r 1 ../e |
12279 | 190 pushing to ../e |
191 searching for changes | |
192 adding changesets | |
193 adding manifests | |
194 adding file changes | |
195 added 1 changesets with 1 changes to 1 files | |
196 | |
197 $ cd .. | |
198 | |
199 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
200 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
|
201 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
|
202 |
12279 | 203 $ hg init f |
204 $ cd f | |
205 $ hg -q branch a | |
206 $ echo 0 > foo | |
207 $ hg -q ci -Am 0 | |
208 $ echo 1 > foo | |
209 $ hg -q ci -m 1 | |
210 $ hg -q up 0 | |
211 $ echo 2 > foo | |
212 $ hg -q ci -m 2 | |
213 $ hg -q up 0 | |
214 $ hg -q branch b | |
215 $ echo 3 > foo | |
216 $ hg -q ci -m 3 | |
217 $ cd .. | |
218 | |
219 $ hg -q clone f g | |
220 $ cd g | |
221 | |
222 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
|
223 |
12279 | 224 $ hg -q up 1 |
225 $ echo 4 > foo | |
226 $ hg -q ci -m 4 | |
227 $ hg -q up 0 | |
228 $ echo 5 > foo | |
229 $ hg -q branch c | |
230 $ hg -q ci -m 5 | |
231 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
232 $ hg push ../f |
12279 | 233 pushing to ../f |
234 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
235 abort: push creates new remote branches: c |
12279 | 236 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
237 [20] |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
238 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
239 $ hg push -r 4 -r 5 ../f |
12279 | 240 pushing to ../f |
241 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
242 abort: push creates new remote branches: c |
12279 | 243 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
244 [20] |
12279 | 245 |
246 | |
247 Multiple new branches: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
248 |
12279 | 249 $ hg -q branch d |
250 $ echo 6 > foo | |
251 $ hg -q ci -m 6 | |
252 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
253 $ hg push ../f |
12279 | 254 pushing to ../f |
255 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
256 abort: push creates new remote branches: c, d |
12279 | 257 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
258 [20] |
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
|
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 6 ../f |
12279 | 261 pushing to ../f |
262 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
263 abort: push creates new remote branches: c, d |
12279 | 264 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
265 [20] |
12279 | 266 |
267 $ cd ../g | |
268 | |
269 | |
270 Fail on multiple head push: | |
271 | |
272 $ hg -q up 1 | |
273 $ echo 7 > foo | |
274 $ hg -q ci -m 7 | |
275 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
276 $ hg push -r 4 -r 7 ../f |
12279 | 277 pushing to ../f |
278 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
279 abort: push creates new remote head 0b715ef6ff8f on branch 'a' |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
280 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
281 [20] |
12279 | 282 |
283 Push replacement head on existing branches: | |
284 | |
285 $ hg -q up 3 | |
286 $ echo 8 > foo | |
287 $ 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
|
288 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
289 $ hg push -r 7 -r 8 ../f |
12279 | 290 pushing to ../f |
291 searching for changes | |
292 adding changesets | |
293 adding manifests | |
294 adding file changes | |
295 added 2 changesets with 2 changes to 1 files | |
296 | |
297 | |
298 Merge of branch a to other branch b followed by unrelated push | |
299 on branch a: | |
300 | |
301 $ hg -q up 7 | |
302 $ HGMERGE=true hg -q merge 8 | |
303 $ hg -q ci -m 9 | |
304 $ hg -q up 8 | |
305 $ echo 10 > foo | |
306 $ hg -q ci -m 10 | |
307 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
308 $ hg push -r 9 ../f |
12279 | 309 pushing to ../f |
310 searching for changes | |
311 adding changesets | |
312 adding manifests | |
313 adding file changes | |
314 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
|
315 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
316 $ hg push -r 10 ../f |
12279 | 317 pushing to ../f |
318 searching for changes | |
319 adding changesets | |
320 adding manifests | |
321 adding file changes | |
322 added 1 changesets with 1 changes to 1 files (+1 heads) | |
323 | |
324 | |
325 Cheating the counting algorithm: | |
326 | |
327 $ hg -q up 9 | |
328 $ HGMERGE=true hg -q merge 2 | |
329 $ hg -q ci -m 11 | |
330 $ hg -q up 1 | |
331 $ echo 12 > foo | |
332 $ hg -q ci -m 12 | |
333 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
334 $ hg push -r 11 -r 12 ../f |
12279 | 335 pushing to ../f |
336 searching for changes | |
337 adding changesets | |
338 adding manifests | |
339 adding file changes | |
340 added 2 changesets with 2 changes to 1 files | |
341 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
342 |
12279 | 343 Failed push of new named branch: |
344 | |
345 $ echo 12 > foo | |
346 $ hg -q ci -m 12a | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
347 [1] |
12279 | 348 $ hg -q up 11 |
349 $ echo 13 > foo | |
350 $ hg -q branch e | |
351 $ 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
|
352 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
353 $ hg push -r 12 -r 13 ../f |
12279 | 354 pushing to ../f |
355 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
356 abort: push creates new remote branches: e |
12279 | 357 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
358 [20] |
12279 | 359 |
360 | |
361 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
|
362 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
363 $ hg push --new-branch -r 12 -r 13 ../f |
12279 | 364 pushing to ../f |
365 searching for changes | |
366 adding changesets | |
367 adding manifests | |
368 adding file changes | |
369 added 1 changesets with 1 changes to 1 files | |
370 | |
21024
7731a2281cf0
spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents:
20501
diff
changeset
|
371 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
|
372 |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
373 $ echo 14 > foo |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
374 $ 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
|
375 $ 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
|
376 $ echo 15 > foo |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
377 $ 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
|
378 $ 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
|
379 $ echo 16 > foo |
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 16 |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
381 $ 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
|
382 pushing to ../f |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
383 searching for changes |
20050
877e05b46509
discovery: tweak error message for multiple branch heads
Mads Kiilerich <madski@unity3d.com>
parents:
19936
diff
changeset
|
384 abort: push creates new branch 'f' with multiple heads |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
385 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
386 [20] |
19840
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
387 $ 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
|
388 pushing to ../f |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
389 searching for changes |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
390 adding changesets |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
391 adding manifests |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
392 adding file changes |
b00ba31313c3
discovery: abort also when pushing multiple headed new branch
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18361
diff
changeset
|
393 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
|
394 |
12785
c7d23b4ca4ba
check-code: warning and fixes for whitespace in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12399
diff
changeset
|
395 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
|
396 multiple new heads but also doesn't report too many heads: |
12279 | 397 |
398 $ cd .. | |
399 $ hg init h | |
400 $ echo init > h/init | |
401 $ hg -R h ci -Am init | |
402 adding init | |
403 $ echo a > h/a | |
404 $ hg -R h ci -Am a | |
405 adding a | |
406 $ hg clone h i | |
407 updating to branch default | |
408 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
409 $ hg -R h up 0 | |
410 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
411 $ echo b > h/b | |
412 $ hg -R h ci -Am b | |
413 adding b | |
414 created new head | |
415 $ hg -R i up 0 | |
416 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
417 $ echo c > i/c | |
418 $ hg -R i ci -Am c | |
419 adding c | |
420 created new head | |
9479
f3569d95c2ab
push: fix subtle bug in prepush logic
Sune Foldager <cryo@cyanite.org>
parents:
8565
diff
changeset
|
421 |
39707
5abc47d4ca6b
tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents:
37338
diff
changeset
|
422 $ 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
|
423 |
12279 | 424 $ hg -R i push h |
425 pushing to h | |
426 searching for changes | |
21198
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
427 remote has heads on branch 'default' that are not known locally: 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847 |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
428 abort: push creates new remote head 97bd0c84d346 |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
429 (pull and merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
430 [20] |
21198
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
431 $ 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
|
432 $ hg -R i push h |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
433 pushing to h |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
434 searching for changes |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
435 remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 and 1 others |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
436 abort: push creates new remote head 97bd0c84d346 |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
437 (pull and merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
438 [20] |
21198
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
439 $ 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
|
440 pushing to h |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
441 searching for changes |
56a04085c23c
discovery: don't report all "unsynced" remote heads (issue4230)
Mads Kiilerich <madski@unity3d.com>
parents:
21024
diff
changeset
|
442 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
|
443 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
|
444 97bd0c84d346 |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
445 abort: push creates new remote head 97bd0c84d346 |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
446 (pull and merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
447 [20] |
12279 | 448 |
449 | |
450 Check prepush logic with merged branches: | |
451 | |
452 $ hg init j | |
453 $ hg -R j branch a | |
454 marked working directory as branch a | |
15615 | 455 (branches are permanent and global, did you want a bookmark?) |
12279 | 456 $ echo init > j/foo |
457 $ hg -R j ci -Am init | |
458 adding foo | |
459 $ hg clone j k | |
460 updating to branch a | |
461 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
462 $ echo a1 > j/foo | |
463 $ hg -R j ci -m a1 | |
464 $ hg -R k branch b | |
465 marked working directory as branch b | |
466 $ echo b > k/foo | |
467 $ hg -R k ci -m b | |
468 $ hg -R k up 0 | |
469 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
470 | |
471 $ hg -R k merge b | |
472 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
473 (branch merge, don't forget to commit) | |
474 | |
475 $ 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
|
476 |
12279 | 477 $ hg -R k push -r a j |
478 pushing to j | |
479 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
480 abort: push creates new remote branches: b |
12279 | 481 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
482 [20] |
12279 | 483 |
484 | |
485 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
|
486 |
12279 | 487 $ hg init l |
488 $ cd l | |
489 $ echo a >> foo | |
490 $ hg -q add foo | |
491 $ hg -q branch a | |
492 $ hg -q ci -ma | |
493 $ hg -q up null | |
494 $ echo a >> foo | |
495 $ hg -q add foo | |
496 $ hg -q branch b | |
497 $ hg -q ci -mb | |
498 $ cd .. | |
499 $ hg -q clone l m -u a | |
500 $ cd m | |
501 $ hg -q merge b | |
502 $ hg -q ci -mmb | |
503 $ hg -q up 0 | |
504 $ echo a >> foo | |
505 $ hg -q ci -ma2 | |
506 $ hg -q up 2 | |
507 $ echo a >> foo | |
508 $ hg -q branch -f b | |
509 $ hg -q ci -mb2 | |
510 $ hg -q merge 3 | |
511 $ hg -q ci -mma | |
512 | |
513 $ hg push ../l -b b | |
514 pushing to ../l | |
515 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
516 abort: push creates new remote head 451211cc22b0 on branch 'a' |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
517 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
518 [20] |
12279 | 519 |
520 $ cd .. | |
521 | |
522 | |
523 Check prepush with new branch head on former topo non-head: | |
524 | |
525 $ hg init n | |
526 $ cd n | |
527 $ hg branch A | |
528 marked working directory as branch A | |
15615 | 529 (branches are permanent and global, did you want a bookmark?) |
12279 | 530 $ echo a >a |
531 $ hg ci -Ama | |
532 adding a | |
533 $ hg branch B | |
534 marked working directory as branch B | |
535 $ echo b >b | |
536 $ hg ci -Amb | |
537 adding b | |
538 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
539 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
|
540 a is now branch head of A, but not a topological head |
12279 | 541 |
542 $ hg clone . inner | |
543 updating to branch B | |
544 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
545 $ cd inner | |
546 $ hg up B | |
547 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
548 $ echo b1 >b1 | |
549 $ hg ci -Amb1 | |
550 adding b1 | |
551 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
552 in the clone b1 is now the head of B |
12279 | 553 |
554 $ cd .. | |
555 $ hg up 0 | |
556 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
557 $ echo a2 >a2 | |
558 $ hg ci -Ama2 | |
559 adding a2 | |
560 | |
12785
c7d23b4ca4ba
check-code: warning and fixes for whitespace in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12399
diff
changeset
|
561 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
|
562 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
|
563 A, not B |
12279 | 564 |
565 glog of local: | |
566 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
567 $ hg log -G --template "{rev}: {branches} {desc}\n" |
12279 | 568 @ 2: A a2 |
569 | | |
570 | o 1: B b | |
571 |/ | |
572 o 0: A a | |
573 | |
574 glog of remote: | |
575 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
576 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n" |
12279 | 577 @ 2: B b1 |
578 | | |
579 o 1: B b | |
580 | | |
581 o 0: A a | |
582 | |
583 outgoing: | |
584 | |
585 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
586 comparing with inner | |
587 searching for changes | |
588 2: A a2 | |
589 | |
590 $ hg push inner | |
591 pushing to inner | |
592 searching for changes | |
593 adding changesets | |
594 adding manifests | |
595 adding file changes | |
596 added 1 changesets with 1 changes to 1 files (+1 heads) | |
597 | |
598 $ cd .. | |
599 | |
600 | |
601 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
|
602 |
12279 | 603 $ hg init o |
604 $ cd o | |
605 $ hg branch A | |
606 marked working directory as branch A | |
15615 | 607 (branches are permanent and global, did you want a bookmark?) |
12279 | 608 $ echo a >a |
609 $ hg ci -Ama | |
610 adding a | |
611 $ hg branch B | |
612 marked working directory as branch B | |
613 $ echo b >b | |
614 $ hg ci -Amb | |
615 adding b | |
616 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
617 b is now branch head of B, and a topological head |
12279 | 618 |
619 $ hg up 0 | |
620 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
621 $ echo a1 >a1 | |
622 $ hg ci -Ama1 | |
623 adding a1 | |
624 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
625 a1 is now branch head of A, and a topological head |
12279 | 626 |
627 $ hg clone . inner | |
628 updating to branch A | |
629 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
630 $ cd inner | |
631 $ hg up B | |
632 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
633 $ echo b1 >b1 | |
634 $ hg ci -Amb1 | |
635 adding b1 | |
636 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
637 in the clone b1 is now the head of B |
12279 | 638 |
639 $ cd .. | |
640 $ echo a2 >a2 | |
641 $ hg ci -Ama2 | |
642 adding a2 | |
643 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
644 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
|
645 it replaces a former topological and branch head, so this should not warn |
12279 | 646 |
647 glog of local: | |
648 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
649 $ hg log -G --template "{rev}: {branches} {desc}\n" |
12279 | 650 @ 3: A a2 |
651 | | |
652 o 2: A a1 | |
653 | | |
654 | o 1: B b | |
655 |/ | |
656 o 0: A a | |
657 | |
658 glog of remote: | |
659 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
660 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n" |
12279 | 661 @ 3: B b1 |
662 | | |
663 | o 2: A a1 | |
664 | | | |
665 o | 1: B b | |
666 |/ | |
667 o 0: A a | |
668 | |
669 outgoing: | |
670 | |
671 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
672 comparing with inner | |
673 searching for changes | |
674 3: A a2 | |
675 | |
676 $ hg push inner | |
677 pushing to inner | |
678 searching for changes | |
679 adding changesets | |
680 adding manifests | |
681 adding file changes | |
682 added 1 changesets with 1 changes to 1 files | |
683 | |
684 $ cd .. | |
685 | |
686 | |
687 Check prepush with new branch head and new child of former branch head | |
688 but child is on different branch: | |
689 | |
690 $ hg init p | |
691 $ cd p | |
692 $ hg branch A | |
693 marked working directory as branch A | |
15615 | 694 (branches are permanent and global, did you want a bookmark?) |
12279 | 695 $ echo a0 >a |
696 $ hg ci -Ama0 | |
697 adding a | |
698 $ echo a1 >a | |
699 $ hg ci -ma1 | |
700 $ hg up null | |
701 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
702 $ hg branch B | |
703 marked working directory as branch B | |
704 $ echo b0 >b | |
705 $ hg ci -Amb0 | |
706 adding b | |
707 $ echo b1 >b | |
708 $ hg ci -mb1 | |
709 | |
710 $ hg clone . inner | |
711 updating to branch B | |
712 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
|
713 |
12279 | 714 $ hg up A |
715 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
716 $ hg branch -f B | |
717 marked working directory as branch B | |
718 $ echo a3 >a | |
719 $ hg ci -ma3 | |
720 created new head | |
721 $ hg up 3 | |
722 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
723 $ hg branch -f A | |
724 marked working directory as branch A | |
725 $ echo b3 >b | |
726 $ hg ci -mb3 | |
727 created new head | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
728 |
12279 | 729 glog of local: |
730 | |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
731 $ hg log -G --template "{rev}: {branches} {desc}\n" |
12279 | 732 @ 5: A b3 |
733 | | |
734 | o 4: B a3 | |
735 | | | |
736 o | 3: B b1 | |
737 | | | |
738 o | 2: B b0 | |
739 / | |
740 o 1: A a1 | |
741 | | |
742 o 0: A a0 | |
743 | |
744 glog of remote: | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
745 |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20051
diff
changeset
|
746 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n" |
12279 | 747 @ 3: B b1 |
748 | | |
749 o 2: B b0 | |
750 | |
751 o 1: A a1 | |
752 | | |
753 o 0: A a0 | |
754 | |
755 outgoing: | |
756 | |
757 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
758 comparing with inner | |
759 searching for changes | |
760 4: B a3 | |
761 5: A b3 | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
762 |
12279 | 763 $ hg push inner |
764 pushing to inner | |
765 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
766 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A' |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
767 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
768 [20] |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
769 |
12279 | 770 $ hg push inner -r4 -r5 |
771 pushing to inner | |
772 searching for changes | |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
773 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A' |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
774 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
775 [20] |
12279 | 776 |
777 $ hg in inner | |
778 comparing with inner | |
779 searching for changes | |
780 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
781 [1] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16023
diff
changeset
|
782 |
29129
e6dfb0e4eeef
dispatch: add fail-* family of hooks
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
27752
diff
changeset
|
783 Test fail hook |
e6dfb0e4eeef
dispatch: add fail-* family of hooks
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
27752
diff
changeset
|
784 |
e6dfb0e4eeef
dispatch: add fail-* family of hooks
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
27752
diff
changeset
|
785 $ hg push inner --config hooks.fail-push="echo running fail-push hook" |
e6dfb0e4eeef
dispatch: add fail-* family of hooks
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
27752
diff
changeset
|
786 pushing to inner |
e6dfb0e4eeef
dispatch: add fail-* family of hooks
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
27752
diff
changeset
|
787 searching for changes |
e6dfb0e4eeef
dispatch: add fail-* family of hooks
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
27752
diff
changeset
|
788 running fail-push hook |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
789 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A' |
29973
4ddb05751b12
discovery: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29659
diff
changeset
|
790 (merge or see 'hg help push' for details about pushing new heads) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
791 [20] |
29129
e6dfb0e4eeef
dispatch: add fail-* family of hooks
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
27752
diff
changeset
|
792 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16023
diff
changeset
|
793 $ cd .. |
42203
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
794 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
795 Test regarding pushing of closed branch/branches(Issue6080) |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
796 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
797 $ hg init x |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
798 $ cd x |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
799 $ hg -q branch a |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
800 $ echo 0 > foo |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
801 $ hg -q ci -Am 0 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
802 $ hg -q up 0 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
803 $ cd .. |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
804 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
805 $ hg -q clone x z |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
806 $ cd z |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
807 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
808 When there is a single closed branch |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
809 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
810 $ hg -q branch foo |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
811 $ echo 0 > foo |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
812 $ hg -q ci -Am 0 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
813 $ hg ci --close-branch -m 'closing branch foo' |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
814 $ hg -q up 0 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
815 $ hg push ../x |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
816 pushing to ../x |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
817 searching for changes |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
818 abort: push creates new remote branches: foo (1 closed) |
42203
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
819 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
820 [20] |
42203
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
821 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
822 When there is more than one closed branches |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
823 $ hg -q branch bar |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
824 $ echo 0 > bar |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
825 $ hg -q ci -Am 0 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
826 $ hg ci --close-branch -m 'closing branch bar' |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
827 $ hg -q up 0 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
828 $ hg push ../x |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
829 pushing to ../x |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
830 searching for changes |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
831 abort: push creates new remote branches: bar, foo (2 closed) |
42203
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
832 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
833 [20] |
42203
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
834 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
835 When there are more than one new branches and not all are closed |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
836 $ hg -q branch bar1 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
837 $ echo 0 > bar1 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
838 $ hg -q ci -Am 0 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
839 $ hg -q up 0 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
840 $ hg push ../x |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
841 pushing to ../x |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
842 searching for changes |
45908
122f0b59f5f0
errors: remove trailing "!" in messages about creating new heads on push
Martin von Zweigbergk <martinvonz@google.com>
parents:
45827
diff
changeset
|
843 abort: push creates new remote branches: bar, bar1, foo (2 closed) |
42203
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
844 (use 'hg push --new-branch' to create new remote branches) |
46119
9261f6c1d39b
errors: raise StateError when push fails because it creates new heads
Martin von Zweigbergk <martinvonz@google.com>
parents:
45908
diff
changeset
|
845 [20] |
42203
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
846 |
5997eabc7b85
push: added clear warning message when pushing closed branches(issue6080)
Taapas Agrawal <taapas2897@gmail.com>
parents:
39707
diff
changeset
|
847 $ cd .. |