[PATCH 5 of 6] commands: merge and resolve have new option tool

S. Heimberg simohe at besonet.ch
Thu Aug 7 14:39:57 CDT 2008


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1218132958 -7200
# Node ID 2275fefc9fcd557de45a59965c8e95c7ce2f2165
# Parent  dec9551b8b6f90113d270bd402ae5b7dbcb7fb7b
commands: merge and resolve have new option tool

new merge option for merge and resolve which allows to set the merge
tool

diff -r dec9551b8b6f -r 2275fefc9fcd mercurial/commands.py
--- a/mercurial/commands.py	Thu Aug 07 20:15:49 2008 +0200
+++ b/mercurial/commands.py	Thu Aug 07 20:15:58 2008 +0200
@@ -1872,7 +1872,7 @@
             ui.write(decor[ctx.flags(f)])
         ui.write("%s\n" % f)

-def merge(ui, repo, node=None, force=None, rev=None):
+def merge(ui, repo, node=None, force=None, rev=None, tool=None):
     """merge working directory with another revision

     Merge the contents of the current working directory and the
@@ -1914,6 +1914,7 @@
             raise util.Abort(_('working dir not at a head rev - '
                                'use "hg update" or merge with an explicit
rev'))
         node = parent == bheads[0] and bheads[-1] or bheads[0]
+    merge_.setmergetool(tool)
     return hg.merge(repo, node, force=force)

 def outgoing(ui, repo, dest=None, **opts):
@@ -2259,6 +2260,7 @@

     ms = merge_.mergestate(repo)
     m = cmdutil.match(repo, pats, opts)
+    merge_.setmergetool(opts.get('tool'))

     for f in ms:
         if m(f):
@@ -2928,6 +2930,10 @@
     ('U', 'unified', '', _('number of lines of context to show'))
 ]

+mergeopts = [
+    ('', 'tool', '', _('force to use merge tool'))
+]
+
 table = {
     "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]...
[FILE]...')),
     "addremove":
@@ -3169,7 +3175,7 @@
         (merge,
          [('f', 'force', None, _('force a merge with outstanding
changes')),
           ('r', 'rev', '', _('revision to merge')),
-             ],
+             ] + mergeopts,
          _('hg merge [-f] [[-r] REV]')),
     "outgoing|out":
         (outgoing,
@@ -3223,7 +3229,7 @@
          [('l', 'list', None, _('list state of files needing merge')),
           ('m', 'mark', None, _('mark files as resolved')),
           ('u', 'unmark', None, _('unmark files as resolved')),]
-          + walkopts,
+          + walkopts + mergeopts,
           ('hg resolve [OPTION] [FILES...]')),
     "revert":
         (revert,



More information about the Mercurial-devel mailing list