Patchwork [1,of,7,mergedriver] merge.applyupdates: don't return early if merge driver's conclude failed

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 16, 2015, 11:46 p.m.
Message ID <076d659bc45077d8a25e.1447717565@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11416/
State Accepted
Headers show

Comments

Siddharth Agarwal - Nov. 16, 2015, 11:46 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1447656320 28800
#      Sun Nov 15 22:45:20 2015 -0800
# Node ID 076d659bc45077d8a25e5c09f7d9666c0e9d46b2
# Parent  51fa43a3cd58ceaaf6fa581726fe2eac7c655d18
merge.applyupdates: don't return early if merge driver's conclude failed

Somewhat silly oversight -- this prevented the progress bar from being reset.
Martin von Zweigbergk - Nov. 16, 2015, 11:54 p.m.
On Mon, Nov 16, 2015 at 3:48 PM Siddharth Agarwal <sid0@fb.com> wrote:

> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1447656320 28800
> #      Sun Nov 15 22:45:20 2015 -0800
> # Node ID 076d659bc45077d8a25e5c09f7d9666c0e9d46b2
> # Parent  51fa43a3cd58ceaaf6fa581726fe2eac7c655d18
> merge.applyupdates: don't return early if merge driver's conclude failed
>
> Somewhat silly oversight -- this prevented the progress bar from being
> reset.
>
> diff --git a/mercurial/merge.py b/mercurial/merge.py
> --- a/mercurial/merge.py
> +++ b/mercurial/merge.py
> @@ -1014,7 +1014,7 @@ def applyupdates(repo, actions, wctx, mc
>          if not driverconclude(repo, ms, wctx, labels=labels):
>              # XXX setting unresolved to at least 1 is a hack to make sure
> we
>              # error out
> -            return updated, merged, removed, max(unresolved, 1)
> +            unresolved = max(unresolved, 1)
>
>          ms.commit()
>

And this ms.commit() gets called after this change too. I hope that's
correct, but I don't really know this mergedriver stuff.


>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>
Siddharth Agarwal - Nov. 16, 2015, 11:58 p.m.
On 11/16/15 15:54, Martin von Zweigbergk wrote:
> And this ms.commit() gets called after this change too. I hope that's 
> correct, but I don't really know this mergedriver stuff.

Yeah, that's fine. ms.commit() is idempotent.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1014,7 +1014,7 @@  def applyupdates(repo, actions, wctx, mc
         if not driverconclude(repo, ms, wctx, labels=labels):
             # XXX setting unresolved to at least 1 is a hack to make sure we
             # error out
-            return updated, merged, removed, max(unresolved, 1)
+            unresolved = max(unresolved, 1)
 
         ms.commit()