# HG changeset patch # User Pierre-Yves David # Date 1577388501 -3600 # Node ID 31b0b29245bbe5e35d09d8e4e101726b2c60740d # Parent ef1978a0fcc04e1a08f07d55525be6330b017aba evolve: further simplify a conditional The case is simple enough to be handled on its own. diff -r ef1978a0fcc0 -r 31b0b29245bb hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Thu Dec 26 20:23:27 2019 +0100 +++ b/hgext3rd/evolve/evolvecmd.py Thu Dec 26 20:28:21 2019 +0100 @@ -430,28 +430,27 @@ # for 2) we will relocate one which is behind to the parent of ahead one and # then solve the content-divergence the way we solve 1) # for 3) and 4), we still have to decide - if succsotherp1 in gca and succsdivp1 in gca: - if succsotherp1 == otherp1 and succsdivp1 == divp1: - # both are on the same parents + if otherp1 == divp1: + # both are on the same parents + pass + elif succsotherp1 in gca and succsdivp1 in gca: + # both are not on the same parent but have same parents's succs. + if otheronly and divonly: + # case: we have visible csets on both side diverging from + # tca of "divergent" and "other". We still need to decide what + # to do in this case pass + if otheronly: + relocatereq = True + if not haspubdiv: + # can't swap when public divergence, as public can't move + divergent, other = swapnodes(divergent, other) + resolutionparent = repo[succsotherp1].node() + elif divonly: + relocatereq = True else: - # both are not on the same parent but have same parents's succs. - if otheronly and divonly: - # case: we have visible csets on both side diverging from - # tca of "divergent" and "other". We still need to decide what - # to do in this case - pass - if otheronly: - relocatereq = True - if not haspubdiv: - # can't swap when public divergence, as public can't move - divergent, other = swapnodes(divergent, other) - resolutionparent = repo[succsotherp1].node() - elif divonly: - relocatereq = True - else: - # no extra cset on either side; so not considering relocation - pass + # no extra cset on either side; so not considering relocation + pass elif succsotherp1 in gca and succsdivp1 not in gca: relocatereq = True pass