changeset 4465:6feeaf00db44

doc: clarify _resolvephasedivergent role and constraint Small documentation patch before larger changes.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 29 Mar 2019 11:48:36 +0100
parents 05f8908df4ce
children cc4506838589
files hgext3rd/evolve/evolvecmd.py
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)