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.
--- 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 <old> "
"--succ <new>` to obsolete the old one") % orig.hex()[:12]
ui.warn(_("warning: no support for evolving merge changesets "