# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1521316622 -19800 # Node ID 6aff754c2457172c5b7e1abd3827a37f3128dcca # Parent 329056287ef5c1170907ed54589eb48278001b1d evolve: make sure we consider all cases in if-else The part of code which is touched decides on evolution of merge changeset. We need proper handling of each case there, so before adding logic, let's add conditional for each case so that upcoming patches are easy to understand. diff -r 329056287ef5 -r 6aff754c2457 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Mon Mar 19 14:03:41 2018 +0100 +++ b/hgext3rd/evolve/evolvecmd.py Sun Mar 18 01:27:02 2018 +0530 @@ -91,10 +91,14 @@ pctx = orig.p1() keepbranch = orig.p1().branch() != orig.branch() if len(orig.parents()) == 2: - if not pctx.obsolete(): + p1obs = orig.p1().obsolete() + p2obs = orig.p2().obsolete() + if not p1obs and p2obs: pctx = orig.p2() # second parent is obsolete ? keepbranch = orig.p2().branch() != orig.branch() - elif orig.p2().obsolete(): + elif not p2obs and p1obs: + pass + else: hint = _("Redo the merge (%s) and use `hg prune " "--succ ` to obsolete the old one") % orig.hex()[:12] ui.warn(_("warning: no support for evolving merge changesets "