diff 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
line wrap: on
line diff
--- a/mercurial/commands.py	Fri May 02 01:09:14 2014 +0200
+++ b/mercurial/commands.py	Mon May 19 01:53:34 2014 +0200
@@ -5797,9 +5797,11 @@
     ('c', 'check', None,
      _('update across branches if no uncommitted changes')),
     ('d', 'date', '', _('tipmost revision matching date'), _('DATE')),
-    ('r', 'rev', '', _('revision'), _('REV'))],
+    ('r', 'rev', '', _('revision'), _('REV'))
+     ] + mergetoolopts,
     _('[-c] [-C] [-d DATE] [[-r] REV]'))
-def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False):
+def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False,
+           tool=None):
     """update working directory (or switch revisions)
 
     Update the repository's working directory to the specified
@@ -5880,6 +5882,8 @@
             rev = repo[repo[None].branch()].rev()
         mergemod._checkunknown(repo, repo[None], repo[rev])
 
+    repo.ui.setconfig('ui', 'forcemerge', tool, 'update')
+
     if clean:
         ret = hg.clean(repo, rev)
     else: