comparison mercurial/merge.py @ 12681:bc13e17067d9

update: use higher level wording for "crosses branches" error When using "hg update" to update to a revision on another branch, if the user has uncommitted changes in the working directory, hg aborts with the following message: abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes) If the user isn't trying to update to tip and they follow the command examples verbatim, they would end up updating to the wrong revision. This patch removes the command examples in favor of just telling the user to either merge or use --clean: abort: crosses branches (merge branches or use --clean to discard changes) hg also aborts if the user tries to use "hg update" to get to tip (without specifying a revision) and tip is on another branch: abort: crosses branches (use 'hg merge' or use 'hg update -c') This message is changed in the same fashion: abort: crosses branches (merge branches or use --check to force update)
author Brodie Rao <brodie@bitheap.org>
date Sat, 09 Oct 2010 17:02:28 -0500
parents 545ec1775021
children 8b438cb84c57
comparison
equal deleted inserted replaced
12680:d664547ef540 12681:bc13e17067d9
500 "(use 'hg status' to list changes)")) 500 "(use 'hg status' to list changes)"))
501 elif not overwrite: 501 elif not overwrite:
502 if pa == p1 or pa == p2: # linear 502 if pa == p1 or pa == p2: # linear
503 pass # all good 503 pass # all good
504 elif wc.files() or wc.deleted(): 504 elif wc.files() or wc.deleted():
505 raise util.Abort(_("crosses branches (use 'hg merge' to merge " 505 raise util.Abort(_("crosses branches (merge branches or use"
506 "or use 'hg update -C' to discard changes)")) 506 " --clean to discard changes)"))
507 elif onode is None: 507 elif onode is None:
508 raise util.Abort(_("crosses branches (use 'hg merge' or use " 508 raise util.Abort(_("crosses branches (merge branches or use"
509 "'hg update -c')")) 509 " --check to force update)"))
510 else: 510 else:
511 # Allow jumping branches if clean and specific rev given 511 # Allow jumping branches if clean and specific rev given
512 overwrite = True 512 overwrite = True
513 513
514 ### calculate phase 514 ### calculate phase