597 # (we do this before stripping) |
597 # (we do this before stripping) |
598 newwd = self.state.get(self.originalwd, self.originalwd) |
598 newwd = self.state.get(self.originalwd, self.originalwd) |
599 if newwd < 0: |
599 if newwd < 0: |
600 # original directory is a parent of rebase set root or ignored |
600 # original directory is a parent of rebase set root or ignored |
601 newwd = self.originalwd |
601 newwd = self.originalwd |
602 if (newwd not in [c.rev() for c in repo[None].parents()] and |
602 if newwd not in [c.rev() for c in repo[None].parents()]: |
603 not self.inmemory): |
|
604 ui.note(_("update back to initial working directory parent\n")) |
603 ui.note(_("update back to initial working directory parent\n")) |
605 hg.updaterepo(repo, newwd, False) |
604 hg.updaterepo(repo, newwd, False) |
606 |
605 |
607 collapsedas = None |
606 collapsedas = None |
608 if self.collapsef and not self.keepf: |
607 if self.collapsef and not self.keepf: |
955 'ancestor of destination %s\n') % dest) |
954 'ancestor of destination %s\n') % dest) |
956 else: # can it happen? |
955 else: # can it happen? |
957 ui.status(_('nothing to rebase from %s to %s\n') % |
956 ui.status(_('nothing to rebase from %s to %s\n') % |
958 ('+'.join(bytes(repo[r]) for r in base), dest)) |
957 ('+'.join(bytes(repo[r]) for r in base), dest)) |
959 return None |
958 return None |
960 # If rebasing the working copy parent, force in-memory merge to be off. |
959 |
961 # |
|
962 # This is because the extra work of checking out the newly rebased commit |
|
963 # outweights the benefits of rebasing in-memory, and executing an extra |
|
964 # update command adds a bit of overhead, so better to just do it on disk. In |
|
965 # all other cases leave it on. |
|
966 # |
|
967 # Note that there are cases where this isn't true -- e.g., rebasing large |
|
968 # stacks that include the WCP. However, I'm not yet sure where the cutoff |
|
969 # is. |
|
970 rebasingwcp = repo['.'].rev() in rebaseset |
960 rebasingwcp = repo['.'].rev() in rebaseset |
971 ui.log("rebase", "", rebase_rebasing_wcp=rebasingwcp) |
961 ui.log("rebase", "", rebase_rebasing_wcp=rebasingwcp) |
972 if rbsrt.inmemory and rebasingwcp: |
962 if rbsrt.inmemory and rebasingwcp: |
973 rbsrt.inmemory = False |
|
974 # Check these since we did not before. |
963 # Check these since we did not before. |
975 cmdutil.checkunfinished(repo) |
964 cmdutil.checkunfinished(repo) |
976 cmdutil.bailifchanged(repo) |
965 cmdutil.bailifchanged(repo) |
977 |
966 |
978 if not destf: |
967 if not destf: |