evolvecmd: introduce fn to be wrapped by extensions resolving content-div
The function added will be used by extension by wrapping it and adding logic to
merge data introduced by them. For example: topic extension can wrap this
function and add logic to merge topic names.
--- a/hgext3rd/evolve/evolvecmd.py Sun Jul 08 21:18:33 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py Sun Jul 08 22:16:17 2018 +0530
@@ -549,6 +549,8 @@
# new node if any formed as the replacement
newnode = None
+ mergehook(repo, base, divergent, other)
+
newnode = repo.commit(text=desc, user=repo.ui.username())
if newnode == divergent.node() or newnode is None:
# no changes
@@ -643,6 +645,11 @@
# this function only
cmdrewrite._uncommitdirstate(repo, oldparent, match, True)
+def mergehook(repo, base, divergent, other):
+ """function which extensions can wrap and merge data introduced by them
+ while resolving content-divergence"""
+ pass
+
def mergebranches(repo, divergent, other, base):
"""merges the branch information for content-divergent changesets and sets
the dirstate branch accordingly