Patchwork [2,of,3,ctx-cleanup] merge: wctx.rev() is never not None

login
register
mail settings
Submitter Sean Farley
Date June 1, 2017, 12:22 a.m.
Message ID <6cdb17d89848a1bdb0fb.1496276527@1.0.0.127.in-addr.arpa>
Download mbox | patch
Permalink /patch/21109/
State Accepted
Headers show

Comments

Sean Farley - June 1, 2017, 12:22 a.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1494536162 25200
#      Thu May 11 13:56:02 2017 -0700
# Branch wctxds
# Node ID 6cdb17d89848a1bdb0fbcac24fe8c8322bb0bb02
# Parent  9879720e90cf13e445d17fc22f53c071a22322d9
merge: wctx.rev() is never not None

Based on Mads Kiilerix's suggestion that even for in-memory merge, this
logic will need to change. It's unused code from 8b846dbc57b6.
Augie Fackler - June 1, 2017, 2:49 p.m.
On Wed, May 31, 2017 at 05:22:07PM -0700, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean@farley.io>
> # Date 1494536162 25200
> #      Thu May 11 13:56:02 2017 -0700
> # Branch wctxds
> # Node ID 6cdb17d89848a1bdb0fbcac24fe8c8322bb0bb02
> # Parent  9879720e90cf13e445d17fc22f53c071a22322d9
> merge: wctx.rev() is never not None

This broke several tests. test-convert-hg-startrev.t was the one I
used to bisect. Dropped for now.

>
> Based on Mads Kiilerix's suggestion that even for in-memory merge, this
> logic will need to change. It's unused code from 8b846dbc57b6.
>
> diff --git a/mercurial/merge.py b/mercurial/merge.py
> index ae57a5f..2ebfae6 100644
> --- a/mercurial/merge.py
> +++ b/mercurial/merge.py
> @@ -1067,13 +1067,12 @@ def calculateupdates(repo, wctx, mctx, a
>                  del actions[f]
>          repo.ui.note(_('end of auction\n\n'))
>
>      _resolvetrivial(repo, wctx, mctx, ancestors[0], actions)
>
> -    if wctx.rev() is None:
> -        fractions = _forgetremoved(wctx, mctx, branchmerge)
> -        actions.update(fractions)
> +    fractions = _forgetremoved(wctx, mctx, branchmerge)
> +    actions.update(fractions)
>
>      return actions, diverge, renamedelete
>
>  def batchremove(repo, actions):
>      """apply removes to the working directory
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Sean Farley - June 1, 2017, 6:30 p.m.
Augie Fackler <raf@durin42.com> writes:

> On Wed, May 31, 2017 at 05:22:07PM -0700, Sean Farley wrote:
>> # HG changeset patch
>> # User Sean Farley <sean@farley.io>
>> # Date 1494536162 25200
>> #      Thu May 11 13:56:02 2017 -0700
>> # Branch wctxds
>> # Node ID 6cdb17d89848a1bdb0fbcac24fe8c8322bb0bb02
>> # Parent  9879720e90cf13e445d17fc22f53c071a22322d9
>> merge: wctx.rev() is never not None
>
> This broke several tests. test-convert-hg-startrev.t was the one I
> used to bisect. Dropped for now.

Eek, sorry about that! I'll investigate and try to fixup (but might fold
it into my other merge.py work).

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
index ae57a5f..2ebfae6 100644
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1067,13 +1067,12 @@  def calculateupdates(repo, wctx, mctx, a
                 del actions[f]
         repo.ui.note(_('end of auction\n\n'))
 
     _resolvetrivial(repo, wctx, mctx, ancestors[0], actions)
 
-    if wctx.rev() is None:
-        fractions = _forgetremoved(wctx, mctx, branchmerge)
-        actions.update(fractions)
+    fractions = _forgetremoved(wctx, mctx, branchmerge)
+    actions.update(fractions)
 
     return actions, diverge, renamedelete
 
 def batchremove(repo, actions):
     """apply removes to the working directory