changeset 5476:d542e9720b1e

orphan: fix buggy case of try resolving orphan merge two times Because of not having the exact condition (see the changes) it was not filtering the case when none of the parent is obsolete. Changes in test file reflect the fixed behavior.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Wed, 22 Jul 2020 23:37:59 +0530
parents 21956b2a16eb
children d60490a28318
files hgext3rd/evolve/evolvecmd.py tests/test-issue-6028.t
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Tue Jul 28 14:26:44 2020 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Jul 22 23:37:59 2020 +0530
@@ -108,7 +108,7 @@
             keepbranch = orig.p2().branch() != orig.branch()
         elif not p2obs and p1obs:
             pass
-        else:
+        elif p1obs and p2obs:
             # store that we are resolving an orphan merge with both parents
             # obsolete and proceed with first parent
             evolvestate[b'orphanmerge'] = True
@@ -2208,7 +2208,7 @@
                 repo.dirstate.setparents(ctxparents[0].node(),
                                          currentp1)
 
-        else:
+        elif p1obs and p2obs:
             # both the parents were obsoleted, if orphanmerge is set, we
             # are processing the second parent first (to keep parent order)
             if evolvestate.get(b'orphanmerge'):
--- a/tests/test-issue-6028.t	Tue Jul 28 14:26:44 2020 +0530
+++ b/tests/test-issue-6028.t	Wed Jul 22 23:37:59 2020 +0530
@@ -167,4 +167,3 @@
 
   $ hg evolve -r .
   cannot solve instability of c920dd828523, skipping
-  cannot solve instability of c920dd828523, skipping