changeset 3622:534af64b0107

evolvecmd: add a detailed comment and some newlines This patch adds a detailed comment on a chunk and some newlines to make things look better and more understandable for upcoming patches.
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 23 Mar 2018 17:21:09 +0530
parents db3ec5f79ab9
children 71fbb679e311
files hgext3rd/evolve/evolvecmd.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Fri Mar 23 17:20:20 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Mar 23 17:21:09 2018 +0530
@@ -225,10 +225,16 @@
         progresscb()
     newid = tmpctx = None
     tmpctx = bumped
-    # Basic check for common parent. Far too complicated and fragile
     tr = repo.currenttransaction()
     assert tr is not None
     bmupdate = _bookmarksupdater(repo, bumped.node(), tr)
+
+    # Checking for whether the phase-divergent changeset has common parents as
+    # it's precursors. Phase-divergent changeset and precursor having different
+    # parents is a result of when the changeset is rebased, grabbed, histedit or
+    # evolved or any other operation which can change parent. In such cases,
+    # when parents are not same, we first rebase the divergent changeset onto
+    # parent or precursor and then perform later steps
     if not list(repo.set('parents(%d) and parents(%d)', bumped.rev(), prec.rev())):
         # Need to rebase the changeset at the right place
         repo.ui.status(
@@ -245,6 +251,7 @@
             msg = _("fix conflict and run 'hg evolve --continue'\n")
             repo.ui.write_err(msg)
             raise
+
     # Create the new commit context
     repo.ui.status(_('computing new diff\n'))
     files = set()
@@ -260,6 +267,7 @@
         if precvalue != val:
             files.add(key)
     files.update(precmanifest)  # add missing files
+
     # commit it
     if files: # something to commit!
         def filectxfn(repo, ctx, path):