# HG changeset patch # User Sushil khanchi # Date 1596617369 -19800 # Node ID eb09d05f69f38a10d639566a6b0f08eaf3c7c482 # Parent 5f2c85ea8b337832821b64a96cf4f2af6c55af03 evolve: move initial evolvestate values to main function This patch will help us simplify the refactoring in upcoming patches. diff -r 5f2c85ea8b33 -r eb09d05f69f3 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Mon Aug 31 15:35:31 2020 +0530 +++ b/hgext3rd/evolve/evolvecmd.py Wed Aug 05 14:19:29 2020 +0530 @@ -289,23 +289,6 @@ def _prepcontentdivresolution(ui, repo, divergent, other, evolvestate): """ if relocation required, decide which divergent cset will be relocated to the other side""" - evolvestate[b'divergent'] = divergent.node() - evolvestate[b'orig-divergent'] = divergent.node() - # sometimes we will relocate a node in case of different parents and we can - # encounter conflicts after relocation is done while solving - # content-divergence and if the user calls `hg evolve --stop`, we need to - # strip that relocated commit. However if `--all` is passed, we need to - # reset this value for each content-divergence resolution which we are doing - # below. - evolvestate[b'relocated-other'] = None - evolvestate[b'relocating-other'] = False - evolvestate[b'relocated-div'] = None - evolvestate[b'relocating-div'] = False - evolvestate[b'relocation-req'] = False - # in case or relocation we get a new other node, we need to store the old - # other for purposes like `--abort` or `--stop` - evolvestate[b'old-other'] = None - evolvestate[b'old-divergent'] = None # we don't handle merge content-divergent changesets yet if len(other.parents()) > 1: @@ -485,8 +468,26 @@ ui.write_err(msg) return (False, b".") other = others[0] + evolvestate[b'divergent'] = divergent.node() evolvestate[b'other-divergent'] = other.node() evolvestate[b'base'] = base.node() + evolvestate[b'orig-divergent'] = divergent.node() + + # sometimes we will relocate a node in case of different parents and we can + # encounter conflicts after relocation is done while solving + # content-divergence and if the user calls `hg evolve --stop`, we need to + # strip that relocated commit. However if `--all` is passed, we need to + # reset this value for each content-divergence resolution which we are doing + # below. + evolvestate[b'relocated-other'] = None + evolvestate[b'relocating-other'] = False + evolvestate[b'relocated-div'] = None + evolvestate[b'relocating-div'] = False + evolvestate[b'relocation-req'] = False + # in case or relocation we get a new other node, we need to store the old + # other for purposes like `--abort` or `--stop` + evolvestate[b'old-other'] = None + evolvestate[b'old-divergent'] = None # setup everything before merging two content-divergent csets datatoproceed = _prepcontentdivresolution(ui, repo, divergent, other,