[PATCH 0 of 1] Select internal conflict resolution tool with a merge option

Isaac Jurado diptongo at gmail.com
Sun Mar 7 10:38:14 CST 2010


Replying Benoit Boissinot:
>
> Careful, those actually don't do the same thing.
> 
> internal:local is only called for *conflicting* files, so if there are
> non conflicting changes in remote, they will still be commited.
> While revert or debugsetparent keeps the working dir to one of the
> parents (all files).

You are right.  The way to do it should be by acting just as
debugsetparents but after the merge checks.

Something like this:

diff -r b98b6a7363ae mercurial/commands.py
--- a/mercurial/commands.py     Sat Mar 06 13:29:54 2010 +0100
+++ b/mercurial/commands.py     Sun Mar 07 17:36:50 2010 +0100
@@ -2254,6 +2254,15 @@
         displayer.close()
         return 0
 
+    if opts.get('dummy'):
+        wlock = repo.wlock()
+        try:
+            repo.dirstate.setparents(repo.lookup(rev1), repo.lookup(rev2))
+        finally:
+            wlock.release()
+        repo.ui.status(_("(dummy merge, don't forget to commit)\n"))
+        return 0
+
     return hg.merge(repo, node, force=opts.get('force'))
 
 def outgoing(ui, repo, dest=None, **opts):
@@ -3684,7 +3693,8 @@
          _('[-r REV]')),
     "^merge":
         (merge,
-         [('f', 'force', None, _('force a merge with outstanding changes')),
+         [('d', 'dummy', None, _('perform a dummy merge keeping working copy')),
+          ('f', 'force', None, _('force a merge with outstanding changes')),
           ('r', 'rev', '', _('revision to merge')),
           ('P', 'preview', None,
            _('review revisions to merge (no merge is performed)'))],


But I believe such code is not very smart.

-- 
Isaac Jurado

"The noblest pleasure is the joy of understanding."
                                  Leonardo da Vinci


More information about the Mercurial-devel mailing list