D1814: rebase: add experimental.inmemory.nomergedriver to turn off IMM
phillco (Phil Cohen)
phabricator at mercurial-scm.org
Fri Jan 5 18:01:14 UTC 2018
phillco created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This gives us an easy way to ensure IMM is disabled automatically if the user configures a
mergedriver script.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1814
AFFECTED FILES
hgext/rebase.py
CHANGE DETAILS
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -799,6 +799,19 @@
elif repo.currenttransaction() is not None:
whynotimm = "rebase run inside a transaction"
+ # in-memory rebase can be configured not to run if a mergedriver is
+ # configured; this should be used only if the driver's preprocess()
+ # scripts might use the working copy.
+ #
+ # (Note: Even without this config, IMM will still abort if any files are
+ # marked by preprocess() to be driver-resolved; however, sometimes the
+ # preprocess() function itself can't be trusted.)
+ #
+ # TODO(phillco): Replace with decorators on the scripts themselves
+ elif (ui.config('experimental', 'mergedriver') and
+ ui.configbool('rebase', 'experimental.inmemory.nomergedriver')):
+ whynotimm = 'mergedriver enabled'
+
if whynotimm:
ui.log("rebase", "disabling IMM because: %s" % whynotimm,
why_not_imm=whynotimm)
To: phillco, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list