# HG changeset patch # User Sushil khanchi # Date 1553443184 -19800 # Node ID fc2214916f50b389e3f4c440011ffc28c8dd8f25 # Parent 819bad27570155899fbf498be60a8649fcf52c2c evolve: add condition in case of pubdiv to not swap the two div csets In public divergence, we have pinned the public cset to the local side when merge is performed. And in divergence resolution implementation divergent cset is the one who is kept at the local side, so to say this in one line: we have pinned public cset to the divergent side. However, in some cases we need to swap the "divergent" and "other" but we can't swap them in case of public divergence as thought would cause an error because of not being able to relocate public cset. diff -r 819bad275701 -r fc2214916f50 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Sat Mar 23 02:10:31 2019 +0530 +++ b/hgext3rd/evolve/evolvecmd.py Sun Mar 24 21:29:44 2019 +0530 @@ -456,10 +456,12 @@ pass if otheronly: relocatereq = True - divergent, other = other, divergent - evolvestate['divergent'] = divergent.node() - evolvestate['other-divergent'] = other.node() - resolutionparent = repo[otherp1].node() + if not haspubdiv: + # can't swap when public divergence, as public can't move + divergent, other = other, divergent + evolvestate['divergent'] = divergent.node() + evolvestate['other-divergent'] = other.node() + resolutionparent = repo[otherp1].node() elif divonly: relocatereq = True else: