evolve: add condition in case of pubdiv to not swap the two div csets
authorSushil khanchi <sushilkhanchi97@gmail.com>
Sun, 24 Mar 2019 21:29:44 +0530
changeset 4443 fc2214916f50
parent 4442 819bad275701
child 4444 ea336a6592cc
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.
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: