5795 @command('^update|up|checkout|co', |
5795 @command('^update|up|checkout|co', |
5796 [('C', 'clean', None, _('discard uncommitted changes (no backup)')), |
5796 [('C', 'clean', None, _('discard uncommitted changes (no backup)')), |
5797 ('c', 'check', None, |
5797 ('c', 'check', None, |
5798 _('update across branches if no uncommitted changes')), |
5798 _('update across branches if no uncommitted changes')), |
5799 ('d', 'date', '', _('tipmost revision matching date'), _('DATE')), |
5799 ('d', 'date', '', _('tipmost revision matching date'), _('DATE')), |
5800 ('r', 'rev', '', _('revision'), _('REV'))], |
5800 ('r', 'rev', '', _('revision'), _('REV')) |
|
5801 ] + mergetoolopts, |
5801 _('[-c] [-C] [-d DATE] [[-r] REV]')) |
5802 _('[-c] [-C] [-d DATE] [[-r] REV]')) |
5802 def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False): |
5803 def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False, |
|
5804 tool=None): |
5803 """update working directory (or switch revisions) |
5805 """update working directory (or switch revisions) |
5804 |
5806 |
5805 Update the repository's working directory to the specified |
5807 Update the repository's working directory to the specified |
5806 changeset. If no changeset is specified, update to the tip of the |
5808 changeset. If no changeset is specified, update to the tip of the |
5807 current named branch and move the current bookmark (see :hg:`help |
5809 current named branch and move the current bookmark (see :hg:`help |
5877 if c.dirty(merge=False, branch=False, missing=True): |
5879 if c.dirty(merge=False, branch=False, missing=True): |
5878 raise util.Abort(_("uncommitted changes")) |
5880 raise util.Abort(_("uncommitted changes")) |
5879 if rev is None: |
5881 if rev is None: |
5880 rev = repo[repo[None].branch()].rev() |
5882 rev = repo[repo[None].branch()].rev() |
5881 mergemod._checkunknown(repo, repo[None], repo[rev]) |
5883 mergemod._checkunknown(repo, repo[None], repo[rev]) |
|
5884 |
|
5885 repo.ui.setconfig('ui', 'forcemerge', tool, 'update') |
5882 |
5886 |
5883 if clean: |
5887 if clean: |
5884 ret = hg.clean(repo, rev) |
5888 ret = hg.clean(repo, rev) |
5885 else: |
5889 else: |
5886 ret = hg.update(repo, rev) |
5890 ret = hg.update(repo, rev) |