changeset 5573:80e55fbda4a4

evolve: remove an evolvestate which is no more required
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Fri, 21 Aug 2020 00:56:24 +0530
parents d7d954b6d518
children e6241483ccec
files hgext3rd/evolve/evolvecmd.py
diffstat 1 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Sun Sep 20 09:22:04 2020 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Aug 21 00:56:24 2020 +0530
@@ -322,8 +322,7 @@
                 evolvestate[b'relocate-other'] = True
         resolutionparent = publicdiv.p1().node()
         evolvestate[b'public-divergent'] = publicdiv.node()
-        relocatereq = evolvestate[b'relocate-other']
-        return (True, divergent, other, resolutionparent, relocatereq)
+        return (True, divergent, other, resolutionparent)
 
     otherp1 = succsotherp1 = other.p1().rev()
     divp1 = succsdivp1 = divergent.p1().rev()
@@ -362,8 +361,6 @@
     # make it exclusive set
     divonly = set(divonly) - {divergent.rev()}
     otheronly = set(otheronly) - {other.rev()}
-    # is relocation of one of the changeset required
-    relocatereq = False
 
     # testing how both the divergent changesets are arranged, there can be 4
     # possible cases here:
@@ -392,17 +389,15 @@
             # to do in this case
             pass
         if otheronly:
-            relocatereq = True
             resolutionparent = repo[succsotherp1].node()
         elif divonly:
-            relocatereq = True
+            pass
         else:
             # no extra cset on either side; so not considering relocation
             pass
     elif succsotherp1 in gca and succsdivp1 not in gca:
-        relocatereq = True
+        pass
     elif succsdivp1 in gca and succsotherp1 not in gca:
-        relocatereq = True
         resolutionparent = repo[succsotherp1].node()
     else:
         msg = _(b"skipping %s: have a different parent than %s "
@@ -419,7 +414,7 @@
         ui.write_err(hint)
         return (False, b".")
 
-    return (True, divergent, other, resolutionparent, relocatereq)
+    return (True, divergent, other, resolutionparent)
 
 def _relocatedivergent(repo, orig, dest, evolvestate):
     """relocates a divergent commit and saves the evolve state"""
@@ -476,7 +471,6 @@
     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
@@ -487,15 +481,13 @@
                                               evolvestate)
     if not datatoproceed[0]:
         return (False, b".")
-    divergent, other, resolutionparent, relocatereq = datatoproceed[1:]
+    divergent, other, resolutionparent = datatoproceed[1:]
 
     if divergent.p1().node() != resolutionparent:
         evolvestate[b'relocate-div'] = True
     if other.p1().node() != resolutionparent:
         evolvestate[b'relocate-other'] = True
 
-    if relocatereq:
-        evolvestate[b'relocation-req'] = True
     evolvestate[b'resolutionparent'] = resolutionparent
 
     if not ui.quiet or confirm: