comparison mercurial/commands.py @ 6375:cdc458b12f0f

update: better logic and messages for updates - complain about attempts to merge with ancestor - when updating, differentiate between - crossing named branches with no local changes (jump) - crossing named branches with local changes (complain) - nonlinear update on the same named branch, no changes (complain some more) - nonlinear update on the same named branch, changes (different complaining)
author Matt Mackall <mpm@selenic.com>
date Mon, 24 Mar 2008 10:01:05 -0500
parents 53912d30ac40
children 0d4e068e9e52
comparison
equal deleted inserted replaced
6374:31a01e3d99cc 6375:cdc458b12f0f
2762 def update(ui, repo, node=None, rev=None, clean=False, date=None): 2762 def update(ui, repo, node=None, rev=None, clean=False, date=None):
2763 """update working directory 2763 """update working directory
2764 2764
2765 Update the working directory to the specified revision, or the 2765 Update the working directory to the specified revision, or the
2766 tip of the current branch if none is specified. 2766 tip of the current branch if none is specified.
2767 See 'hg help dates' for a list of formats valid for -d/--date. 2767
2768 2768 If the requested revision is a descendant of the working
2769 If there are no outstanding changes in the working directory, the 2769 directory, any outstanding changes in the working directory will
2770 result is the requested version. 2770 be merged into the result. If it is not directly descended but is
2771 2771 on the same named branch, update aborts with a suggestion to use
2772 If the requested version is a descendant of the working directory 2772 merge or update -C instead.
2773 and there are outstanding changes, those changes will be merged 2773
2774 into the result. 2774 If the requested revision is on a different named branch and the
2775 2775 working directory is clean, update quietly switches branches.
2776 By default, update will refuse to run if there are outstanding 2776
2777 changes and the update spans branches. 2777 See 'hg help dates' for a list of formats valid for --date.
2778 """ 2778 """
2779 if rev and node: 2779 if rev and node:
2780 raise util.Abort(_("please specify just one revision")) 2780 raise util.Abort(_("please specify just one revision"))
2781 2781
2782 if not rev: 2782 if not rev: