comparison mercurial/commands.py @ 21552:61151f429a5f

update: introduce --tool for controlling the merge tool Update is a kind of merge and may also need a merge tool and should have the options described in the merge-tools help.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 19 May 2014 01:53:34 +0200
parents 6062593d8b06
children bee0e1cffdd3
comparison
equal deleted inserted replaced
21551:bde505f47141 21552:61151f429a5f
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)