Index: hgext/rebase.py =================================================================== --- hgext/rebase.py +++ hgext/rebase.py @@ -179,6 +179,7 @@ # other extensions self.keepopen = opts.get('keepopen', False) self.obsoletenotrebased = {} + self.inmemory = opts.get('inmemory', False) @property def repo(self): @@ -382,6 +383,12 @@ def _performrebase(self, tr): repo, ui = self.repo, self.ui + # Assign a working copy object. + if self.inmemory: + from mercurial.context import overlayworkingctx + self.wctx = overlayworkingctx(self.repo) + else: + self.wctx = self.repo[None] if self.keepbranchesf: # insert _savebranch at the start of extrafns so if # there's a user-provided extrafn it can clobber branch if @@ -593,6 +600,7 @@ ('i', 'interactive', False, _('(DEPRECATED)')), ('t', 'tool', '', _('specify merge tool')), ('c', 'continue', False, _('continue an interrupted rebase')), + ('', 'inmemory', False, _('run rebase in-memory')), ('a', 'abort', False, _('abort an interrupted rebase'))] + templateopts, _('[-s REV | -b REV] [-d REV] [OPTION]')) @@ -699,6 +707,8 @@ unresolved conflicts. """ + if 'inmemory' not in opts: + opts['inmemory'] = False rbsrt = rebaseruntime(repo, ui, opts) with repo.wlock(), repo.lock():