hgext3rd/evolve/evolvecmd.py
changeset 4416 b2a8e67b0933
parent 4415 29733c2b0fd3
child 4417 b86413cfca4a
--- a/hgext3rd/evolve/evolvecmd.py	Thu Feb 28 02:08:58 2019 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Feb 22 01:02:51 2019 +0530
@@ -516,8 +516,11 @@
         # divergent with that same public cset.
         # here newnode is phase divergent, lets resolve this divergence.
         if not res:
+            # resolution was not successful, return
             return (res, newnode)
-
+        if newnode == publicdiv.node():
+            # no changes were found that are different from public cset
+            return (res, newnode)
         prec = publicdiv
         bumped = repo[newnode]
         return _resolvephasedivergent(ui, repo, prec=prec, bumped=bumped,
@@ -570,6 +573,19 @@
         haspubdiv = True
         publicnode = evolvestate['public-divergent']
         publicdiv = repo[publicnode]
+        othernode = evolvestate['other-divergent']
+        otherdiv = repo[othernode]
+
+        with repo.dirstate.parentchange():
+            repo.dirstate.setparents(publicnode, nodemod.nullid)
+            dirstatedance(repo, divergent, publicnode, None)
+        # check if node to be committed has changes same as public one
+        s = publicdiv.status()
+        if not (s.added or s.removed or s.deleted or s.modified):
+            # no changes, create markers to resolve divergence
+            obsolete.createmarkers(repo, [(otherdiv, (publicdiv,))],
+                                   operation='evolve')
+            return (True, publicnode)
     try:
         with repo.dirstate.parentchange():
             repo.dirstate.setparents(resparent, nodemod.nullid)