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

Augie Fackler raf at durin42.com
Thu Jun 1 10:49:50 EDT 2017


On Wed, May 31, 2017 at 05:22:07PM -0700, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean at 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 at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list