# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1527023174 -19800 # Node ID a19703c6d2bb1c7deb8fac6a841683f40080da40 # Parent 73ee40cbfb53f80cd38b8b8e04f4d2eb28a3aa24 evolve: check for None before adding in set of revisions to strip After previous patch, replacements can contain None. Let's make sure we don't add None to the revisions to strip during `hg evolve --abort` The test changes demonstrate the usefulness of this and the previous patch. Now abort is working and public changesets are not a problem. diff -r 73ee40cbfb53 -r a19703c6d2bb hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Wed May 23 02:33:14 2018 +0530 +++ b/hgext3rd/evolve/evolvecmd.py Wed May 23 02:36:14 2018 +0530 @@ -1312,7 +1312,8 @@ cleanup = True startnode = evolvestate['startnode'] for old, new in evolvestate['replacements'].iteritems(): - evolvedctx.append(repo[new]) + if new: + evolvedctx.append(repo[new]) evolvedrevs = [c.rev() for c in evolvedctx] # checking if phase changed of any of the evolved rev diff -r 73ee40cbfb53 -r a19703c6d2bb tests/test-evolve-abort-phasediv.t --- a/tests/test-evolve-abort-phasediv.t Wed May 23 02:33:14 2018 +0530 +++ b/tests/test-evolve-abort-phasediv.t Wed May 23 02:36:14 2018 +0530 @@ -189,14 +189,13 @@ [255] $ hg evolve --abort - cannot clean up public changesets: c41c793e0ef1 - abort: unable to abort interrupted evolve, use 'hg evolve --stop' to stop evolve - [255] + evolve aborted + working directory is now at 28cd06b3f801 $ hg glog --hidden x 10:b7aedbe61ce6 added d | () draft - | * 9:28cd06b3f801 added c + | @ 9:28cd06b3f801 added c | | () draft | | x 8:9ff8adbe8a24 added c | |/ () draft @@ -210,7 +209,7 @@ | | () public o | 3:ca1b80f7960a added c | | () public - @ | 2:b1661037fa25 added b + o | 2:b1661037fa25 added b |/ () public o 1:c7586e2a9264 added a | () public