Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/rebase.py (41 lines) |
# rebasing in-memory (it's not needed). | # rebasing in-memory (it's not needed). | ||||
if singletr and not inmemory: | if singletr and not inmemory: | ||||
dsguard = dirstateguard.dirstateguard(repo, 'rebase') | dsguard = dirstateguard.dirstateguard(repo, 'rebase') | ||||
with util.acceptintervention(dsguard): | with util.acceptintervention(dsguard): | ||||
rbsrt._performrebase(tr) | rbsrt._performrebase(tr) | ||||
rbsrt._finishrebase() | rbsrt._finishrebase() | ||||
def _shoulddisableimm(ui, repo, rebaseset): | |||||
"""returns if we should disable in-memory merge based on the rebaseset""" | |||||
# If rebasing the working copy parent, force in-memory merge to be off. | |||||
# | |||||
# This is because the extra work of checking out the newly rebased commit | |||||
# outweights the benefits of rebasing in-memory, and executing an extra | |||||
# update command adds a bit of overhead, so better to just do it on disk. In | |||||
# all other cases leave it on. | |||||
# | |||||
# Note that there are cases where this isn't true -- e.g., rebasing large | |||||
# stacks that include the WCP. However, I'm not yet sure where the cutoff | |||||
# is. | |||||
rebasingwcp = repo['.'].rev() in rebaseset | |||||
ui.log("rebase", "", rebase_rebasing_wcp=rebasingwcp) | |||||
if rebasingwcp: | |||||
whynotimm = "wcp in rebaseset" | |||||
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, | def _definedestmap(ui, repo, rbsrt, destf=None, srcf=None, basef=None, | ||||
revf=None, destspace=None): | revf=None, destspace=None): | ||||
"""use revisions argument to define destmap {srcrev: destrev}""" | """use revisions argument to define destmap {srcrev: destrev}""" | ||||
if revf is None: | if revf is None: | ||||
revf = [] | revf = [] | ||||
# destspace is here to work around issues with `hg pull --rebase` see | # destspace is here to work around issues with `hg pull --rebase` see | ||||
# issue5214 for details | # issue5214 for details | ||||
else: | else: | ||||
ui.status(_('nothing to rebase - working ' | ui.status(_('nothing to rebase - working ' | ||||
'directory parent is already an ' | 'directory parent is already an ' | ||||
'ancestor of destination %s\n') % dest) | 'ancestor of destination %s\n') % dest) | ||||
else: # can it happen? | else: # can it happen? | ||||
ui.status(_('nothing to rebase from %s to %s\n') % | ui.status(_('nothing to rebase from %s to %s\n') % | ||||
('+'.join(str(repo[r]) for r in base), dest)) | ('+'.join(str(repo[r]) for r in base), dest)) | ||||
return None | return None | ||||
# If rebasing the working copy parent, force in-memory merge to be off. | |||||
# | # Possibly disable in-memory merge based on the rebaseset. | ||||
# This is because the extra work of checking out the newly rebased commit | if rbsrt.inmemory and _shoulddisableimm(ui, repo, rebaseset): | ||||
# outweights the benefits of rebasing in-memory, and executing an extra | |||||
# update command adds a bit of overhead, so better to just do it on disk. In | |||||
# all other cases leave it on. | |||||
# | |||||
# Note that there are cases where this isn't true -- e.g., rebasing large | |||||
# stacks that include the WCP. However, I'm not yet sure where the cutoff | |||||
# is. | |||||
rebasingwcp = repo['.'].rev() in rebaseset | |||||
ui.log("rebase", "", rebase_rebasing_wcp=rebasingwcp) | |||||
if rbsrt.inmemory and rebasingwcp: | |||||
rbsrt.inmemory = False | rbsrt.inmemory = False | ||||
whynotimm = "wcp in rebaseset" | |||||
ui.log("rebase", "disabling IMM because: %s" % whynotimm, | |||||
why_not_imm=whynotimm) | |||||
# Check these since we did not before. | # Check these since we did not before. | ||||
cmdutil.checkunfinished(repo) | cmdutil.checkunfinished(repo) | ||||
cmdutil.bailifchanged(repo) | cmdutil.bailifchanged(repo) | ||||
if not destf: | if not destf: | ||||
dest = repo[_destrebase(repo, rebaseset, destspace=destspace)] | dest = repo[_destrebase(repo, rebaseset, destspace=destspace)] | ||||
destf = str(dest) | destf = str(dest) |