Show More
@@ -221,12 +221,12 b' def update(repo, node, branchmerge=False' | |||||
221 | backwards = (pa == p2) |
|
221 | backwards = (pa == p2) | |
222 |
|
222 | |||
223 | # is there a linear path from p1 to p2? |
|
223 | # is there a linear path from p1 to p2? | |
224 |
linear |
|
224 | linear = (pa == p1 or pa == p2) | |
225 |
if branchmerge and linear |
|
225 | if branchmerge and linear: | |
226 | raise util.Abort(_("there is nothing to merge, just use " |
|
226 | raise util.Abort(_("there is nothing to merge, just use " | |
227 | "'hg update' or look at 'hg heads'")) |
|
227 | "'hg update' or look at 'hg heads'")) | |
228 |
|
228 | |||
229 |
if not linear |
|
229 | if not linear and not (overwrite or branchmerge): | |
230 | raise util.Abort(_("update spans branches, use 'hg merge' " |
|
230 | raise util.Abort(_("update spans branches, use 'hg merge' " | |
231 | "or 'hg update -C' to lose changes")) |
|
231 | "or 'hg update -C' to lose changes")) | |
232 |
|
232 | |||
@@ -244,7 +244,7 b' def update(repo, node, branchmerge=False' | |||||
244 | # we care about merging |
|
244 | # we care about merging | |
245 | repo.ui.note(_("resolving manifests\n")) |
|
245 | repo.ui.note(_("resolving manifests\n")) | |
246 | repo.ui.debug(_(" overwrite %s branchmerge %s partial %s linear %s\n") % |
|
246 | repo.ui.debug(_(" overwrite %s branchmerge %s partial %s linear %s\n") % | |
247 |
(overwrite, branchmerge, bool(partial), linear |
|
247 | (overwrite, branchmerge, bool(partial), linear)) | |
248 | repo.ui.debug(_(" ancestor %s local %s remote %s\n") % |
|
248 | repo.ui.debug(_(" ancestor %s local %s remote %s\n") % | |
249 | (short(p1), short(p2), short(pa))) |
|
249 | (short(p1), short(p2), short(pa))) | |
250 |
|
250 | |||
@@ -253,14 +253,14 b' def update(repo, node, branchmerge=False' | |||||
253 |
|
253 | |||
254 | if not force: |
|
254 | if not force: | |
255 | checkunknown(repo, m2, status) |
|
255 | checkunknown(repo, m2, status) | |
256 |
if linear |
|
256 | if linear: | |
257 | action += forgetremoved(m2, status) |
|
257 | action += forgetremoved(m2, status) | |
258 | action += manifestmerge(repo.ui, m1, m2, ma, overwrite, backwards, partial) |
|
258 | action += manifestmerge(repo.ui, m1, m2, ma, overwrite, backwards, partial) | |
259 | del m1, m2, ma |
|
259 | del m1, m2, ma | |
260 |
|
260 | |||
261 | ### apply phase |
|
261 | ### apply phase | |
262 |
|
262 | |||
263 |
if linear |
|
263 | if linear or overwrite: | |
264 | # we don't need to do any magic, just jump to the new rev |
|
264 | # we don't need to do any magic, just jump to the new rev | |
265 | p1, p2 = p2, nullid |
|
265 | p1, p2 = p2, nullid | |
266 |
|
266 |
General Comments 0
You need to be logged in to leave comments.
Login now