doc: clarify _resolvephasedivergent role and constraint
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 29 Mar 2019 11:48:36 +0100
changeset 4465 6feeaf00db44
parent 4464 05f8908df4ce
child 4466 cc4506838589
doc: clarify _resolvephasedivergent role and constraint Small documentation patch before larger changes.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Tue Apr 02 20:32:15 2019 +0200
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Mar 29 11:48:36 2019 +0100
@@ -259,6 +259,14 @@
     return _resolvephasedivergent(ui, repo, prec, bumped, tmpctx)
 
 def _resolvephasedivergent(ui, repo, prec, bumped, tmpctx=None):
+    """final step of a phase divergence resolution
+
+    This will create a new changesets (or nothing when applicable), the two
+    changesets needs to be on the same parents.
+
+    XXX we should deal with all tmpctx business before callin this function and
+    pass tmpctx as bumped directly
+    """
 
     tr = repo.currenttransaction()
     assert tr is not None
@@ -273,6 +281,11 @@
         rebasedbmupdate = _bookmarksupdater(repo, tmpctx.node(), tr)
         bumped = tmpctx
 
+    cl = repo.changelog
+    prec_parent = cl.parentrevs(prec.rev())
+    bump_parent = cl.parentrevs(bumped.rev())
+    assert prec_parent == bump_parent, (prec_parent, bump_parent)
+
     # Create the new commit context
     files = set()
     copied = copies.pathcopies(prec, bumped)