##// END OF EJS Templates
rebase: disable `inmemory` if the rebaseset contains the working copy...
Phil Cohen -
r35333:03bec089 default
parent child Browse files
Show More
@@ -830,7 +830,8 b' def _origrebase(ui, repo, **opts):'
830 else:
830 else:
831 destmap = _definedestmap(ui, repo, destf, srcf, basef, revf,
831 destmap = _definedestmap(ui, repo, destf, srcf, basef, revf,
832 destspace=destspace,
832 destspace=destspace,
833 inmemory=opts['inmemory'])
833 opts=opts)
834 rbsrt.inmemory = opts['inmemory']
834 retcode = rbsrt._preparenewrebase(destmap)
835 retcode = rbsrt._preparenewrebase(destmap)
835 if retcode is not None:
836 if retcode is not None:
836 return retcode
837 return retcode
@@ -850,7 +851,7 b' def _origrebase(ui, repo, **opts):'
850 rbsrt._finishrebase()
851 rbsrt._finishrebase()
851
852
852 def _definedestmap(ui, repo, destf=None, srcf=None, basef=None, revf=None,
853 def _definedestmap(ui, repo, destf=None, srcf=None, basef=None, revf=None,
853 destspace=None, inmemory=False):
854 destspace=None, opts=None):
854 """use revisions argument to define destmap {srcrev: destrev}"""
855 """use revisions argument to define destmap {srcrev: destrev}"""
855 if revf is None:
856 if revf is None:
856 revf = []
857 revf = []
@@ -864,7 +865,7 b' def _definedestmap(ui, repo, destf=None,'
864 if revf and srcf:
865 if revf and srcf:
865 raise error.Abort(_('cannot specify both a revision and a source'))
866 raise error.Abort(_('cannot specify both a revision and a source'))
866
867
867 if not inmemory:
868 if not opts['inmemory']:
868 cmdutil.checkunfinished(repo)
869 cmdutil.checkunfinished(repo)
869 cmdutil.bailifchanged(repo)
870 cmdutil.bailifchanged(repo)
870
871
@@ -939,6 +940,22 b' def _definedestmap(ui, repo, destf=None,'
939 ui.status(_('nothing to rebase from %s to %s\n') %
940 ui.status(_('nothing to rebase from %s to %s\n') %
940 ('+'.join(str(repo[r]) for r in base), dest))
941 ('+'.join(str(repo[r]) for r in base), dest))
941 return None
942 return None
943 # If rebasing the working copy parent, force in-memory merge to be off.
944 #
945 # This is because the extra work of checking out the newly rebased commit
946 # outweights the benefits of rebasing in-memory, and executing an extra
947 # update command adds a bit of overhead, so better to just do it on disk. In
948 # all other cases leave it on.
949 #
950 # Note that there are cases where this isn't true -- e.g., rebasing large
951 # stacks that include the WCP. However, I'm not yet sure where the cutoff
952 # is.
953 rebasingwcp = repo['.'].rev() in rebaseset
954 if opts['inmemory'] and rebasingwcp:
955 opts['inmemory'] = False
956 # Check these since we did not before.
957 cmdutil.checkunfinished(repo)
958 cmdutil.bailifchanged(repo)
942
959
943 if not destf:
960 if not destf:
944 dest = repo[_destrebase(repo, rebaseset, destspace=destspace)]
961 dest = repo[_destrebase(repo, rebaseset, destspace=destspace)]
General Comments 0
You need to be logged in to leave comments. Login now