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