Patchwork [2,of,2] resolve: set forcemerge before calling preprocess

login
register
mail settings
Submitter Siddharth Agarwal
Date March 21, 2016, 1 a.m.
Message ID <98fd14c2b4b6b00e8409.1458522053@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/13999/
State Superseded
Headers show

Comments

Siddharth Agarwal - March 21, 2016, 1 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1458521572 25200
#      Sun Mar 20 17:52:52 2016 -0700
# Node ID 98fd14c2b4b6b00e8409bb88dee3d0ba26ebaf75
# Parent  b190b4bd5de25c137286cbb21572e9e1160b415b
resolve: set forcemerge before calling preprocess

If the merge driver's preprocess step decides to resolve some files, it is
important that any custom tools are used, unless the merge driver does further
overrides. This is already the case for merge, rebase, and other commands that
take tools, but currently isn't the case for resolve.
Siddharth Agarwal - March 21, 2016, 1:03 a.m.
On 3/20/16 18:00, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1458521572 25200
> #      Sun Mar 20 17:52:52 2016 -0700
> # Node ID 98fd14c2b4b6b00e8409bb88dee3d0ba26ebaf75
> # Parent  b190b4bd5de25c137286cbb21572e9e1160b415b
> resolve: set forcemerge before calling preprocess

Actually I want to do further refactoring and am going to send a better 
series of patches.

- Siddharth

>
> If the merge driver's preprocess step decides to resolve some files, it is
> important that any custom tools are used, unless the merge driver does further
> overrides. This is already the case for merge, rebase, and other commands that
> take tools, but currently isn't the case for resolve.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -6033,7 +6033,9 @@ def resolve(ui, repo, *pats, **opts):
>           wctx = repo[None]
>   
>           if ms.mergedriver and ms.mdstate() == 'u':
> -            proceed = mergemod.driverpreprocess(repo, ms, wctx)
> +            with ui.tempconfig('ui', 'forcemerge', opts.get('tool', ''),
> +                               'resolve'):
> +                proceed = mergemod.driverpreprocess(repo, ms, wctx)
>               ms.commit()
>               # allow mark and unmark to go through
>               if not mark and not unmark and not proceed:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6033,7 +6033,9 @@  def resolve(ui, repo, *pats, **opts):
         wctx = repo[None]
 
         if ms.mergedriver and ms.mdstate() == 'u':
-            proceed = mergemod.driverpreprocess(repo, ms, wctx)
+            with ui.tempconfig('ui', 'forcemerge', opts.get('tool', ''),
+                               'resolve'):
+                proceed = mergemod.driverpreprocess(repo, ms, wctx)
             ms.commit()
             # allow mark and unmark to go through
             if not mark and not unmark and not proceed: