Index: hgext/rebase.py =================================================================== --- hgext/rebase.py +++ hgext/rebase.py @@ -17,6 +17,7 @@ from __future__ import absolute_import import errno +import itertools import os from mercurial.i18n import _ @@ -907,6 +908,20 @@ why_not_imm=whynotimm) return True + # Check for paths in the rebaseset that are likely to later trigger + # conflicts or a mergedriver run (and thus cause the whole rebase to later + # be restarted). + badpaths = ui.configlist("rebase", "experimental.inmemory_disallowed_paths") + if badpaths: + rebasepaths = set(itertools.chain(*[repo[rev].files() for rev + in rebaseset])) + intersection = set(badpaths).intersection(rebasepaths) + if intersection: + whynotimm = "paths matched inmemory_disallowed_paths" + ui.log("rebase", "disabling IMM because: %s" % whynotimm, + why_not_imm=whynotimm) + return True + return False # no change def _definedestmap(ui, repo, rbsrt, destf=None, srcf=None, basef=None,