Patchwork D1232: rebase: add the --inmemory option flag; assign a wctx object for the rebase

login
register
mail settings
Submitter phabricator
Date Dec. 7, 2017, 10:15 p.m.
Message ID <e7eba595e690d393d2777a9c18c72624@localhost.localdomain>
Download mbox | patch
Permalink /patch/26054/
State Not Applicable
Headers show

Comments

phabricator - Dec. 7, 2017, 10:15 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG482614b3802a: rebase: add the --inmemory option flag; assign a wctx object for the rebase (authored by phillco, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1232?vs=4196&id=4220

REVISION DETAIL
  https://phab.mercurial-scm.org/D1232

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: phillco, #hg-reviewers, dlax, durin42
Cc: durin42, dlax, mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -179,6 +179,7 @@ 
         self.keepopen = opts.get('keepopen', False)
         self.obsoletenotrebased = {}
         self.obsoletewithoutsuccessorindestination = set()
+        self.inmemory = opts.get('inmemory', False)
 
     @property
     def repo(self):
@@ -383,6 +384,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
@@ -608,6 +615,7 @@ 
     ('i', 'interactive', False, _('(DEPRECATED)')),
     ('t', 'tool', '', _('specify merge tool')),
     ('c', 'continue', False, _('continue an interrupted rebase')),
+    ('',  'inmemory', False, _('run rebase in-memory (EXPERIMENTAL)')),
     ('a', 'abort', False, _('abort an interrupted rebase'))] +
     cmdutil.formatteropts,
     _('[-s REV | -b REV] [-d REV] [OPTION]'))
@@ -726,6 +734,8 @@ 
 
     """
     opts = pycompat.byteskwargs(opts)
+    if 'inmemory' not in opts:
+        opts['inmemory'] = False
     rbsrt = rebaseruntime(repo, ui, opts)
 
     with repo.wlock(), repo.lock():