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