# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1517250645 -19800 # Node ID a7cac3fcc49ddc547a85ff7d8fb25d7a94961b85 # Parent 14cd04ff968ea8acf2ec7fb1b41e302d4a4a41d3 evolve: store the skippedrevs in evolvestate While doing `hg evolve`, there are some revs which are skipped as they can't be evolved. Before this patch, we did not store this information in evolvestate and neither they were evolved, so `hg evolve --continue` will again try to stabilize those revisions. As much time as we run `hg evolve --continue`, this will happen which is not a good behavior. This patch adds a skippedrevs list to evolvestate where we store such revisions so that we don't try to stabilize them again. diff -r 14cd04ff968e -r a7cac3fcc49d hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Mon Jan 29 00:09:44 2018 +0530 +++ b/hgext3rd/evolve/evolvecmd.py Tue Jan 30 00:00:45 2018 +0530 @@ -1152,11 +1152,14 @@ for rev in evolvestate['revs']: # XXX: prevent this lookup by storing nodes instead of revnums curctx = unfi[rev] - if curctx.node() not in evolvestate['replacements']: + if (curctx.node() not in evolvestate['replacements'] and + curctx.node() not in evolvestate['skippedrevs']): newnode = _solveone(ui, repo, curctx, evolvestate, False, confirm, progresscb, category) if newnode[0]: evolvestate['replacements'][curctx.node()] = newnode[1] + else: + evolvestate['skippedrevs'].append(curctx.node()) _cleanup(ui, repo, unfi[startnode], True) evolvestate.delete() @@ -1175,8 +1178,10 @@ if targetcat == 'orphan': revs = _orderrevs(repo, revs) + # cbor does not know how to serialize sets, using list for skippedrevs stateopts = {'category': targetcat, 'replacements': {}, 'revs': revs, - 'confirm': confirmopt, 'startnode': startnode.node()} + 'confirm': confirmopt, 'startnode': startnode.node(), + 'skippedrevs': []} evolvestate.addopts(stateopts) for rev in revs: curctx = repo[rev] @@ -1186,5 +1191,7 @@ seen += 1 if ret[0]: evolvestate['replacements'][curctx.node()] = [ret[1]] + else: + evolvestate['skippedrevs'].append(curctx.node()) progresscb() _cleanup(ui, repo, startnode, showprogress)