Patchwork [1,of,4] merge: drop special parent assignment in the obsolete case

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 7, 2015, 7:02 p.m.
Message ID <23de95a90992c0bd0ea7.1444244541@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10862/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 7, 2015, 7:02 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1444034853 25200
#      Mon Oct 05 01:47:33 2015 -0700
# Node ID 23de95a90992c0bd0ea76b17e6c9ba2fba5f3c13
# Parent  f71ff13ffcc99ca3f4851de1e1cebbdb4b3de913
merge: drop special parent assignment in the obsolete case

We can safely drop this because the very same assignment is enforcement later in
the function. Dropping it will make it simpler to extract the default
destination logic in its own function.
Augie Fackler - Oct. 8, 2015, 5:35 p.m.
On Wed, Oct 07, 2015 at 12:02:21PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1444034853 25200
> #      Mon Oct 05 01:47:33 2015 -0700
> # Node ID 23de95a90992c0bd0ea76b17e6c9ba2fba5f3c13
> # Parent  f71ff13ffcc99ca3f4851de1e1cebbdb4b3de913
> merge: drop special parent assignment in the obsolete case

taking this one, need to meditate on the rest of the series some more

>
> We can safely drop this because the very same assignment is enforcement later in
> the function. Dropping it will make it simpler to extract the default
> destination logic in its own function.
>
> diff --git a/mercurial/merge.py b/mercurial/merge.py
> --- a/mercurial/merge.py
> +++ b/mercurial/merge.py
> @@ -995,12 +995,10 @@ def update(repo, node, branchmerge, forc
>
>          if node is None:
>              nodes = list(repo.set('_updatedefaultdest()'))
>              if nodes:
>                  node = nodes[0].node()
> -                if p1.obsolete() and not p1.children():
> -                    pas = [p1]
>
>          overwrite = force and not branchmerge
>
>          p2 = repo[node]
>          if pas[0] is None:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -995,12 +995,10 @@  def update(repo, node, branchmerge, forc
 
         if node is None:
             nodes = list(repo.set('_updatedefaultdest()'))
             if nodes:
                 node = nodes[0].node()
-                if p1.obsolete() and not p1.children():
-                    pas = [p1]
 
         overwrite = force and not branchmerge
 
         p2 = repo[node]
         if pas[0] is None: