changeset 35291:aa660c1203a9

rebase: do not bail on uncomitted changes if rebasing in-memory Differential Revision: https://phab.mercurial-scm.org/D1233
author Phil Cohen <phillco@fb.com>
date Thu, 07 Dec 2017 13:20:47 -0800
parents 482614b3802a
children 306a8604741f
files hgext/rebase.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Dec 07 13:25:23 2017 -0800
+++ b/hgext/rebase.py	Thu Dec 07 13:20:47 2017 -0800
@@ -784,7 +784,8 @@
                 return retcode
         else:
             destmap = _definedestmap(ui, repo, destf, srcf, basef, revf,
-                                     destspace=destspace)
+                                     destspace=destspace,
+                                     inmemory=opts['inmemory'])
             retcode = rbsrt._preparenewrebase(destmap)
             if retcode is not None:
                 return retcode
@@ -804,7 +805,7 @@
         rbsrt._finishrebase()
 
 def _definedestmap(ui, repo, destf=None, srcf=None, basef=None, revf=None,
-                   destspace=None):
+                   destspace=None, inmemory=False):
     """use revisions argument to define destmap {srcrev: destrev}"""
     if revf is None:
         revf = []
@@ -818,8 +819,9 @@
     if revf and srcf:
         raise error.Abort(_('cannot specify both a revision and a source'))
 
-    cmdutil.checkunfinished(repo)
-    cmdutil.bailifchanged(repo)
+    if not inmemory:
+        cmdutil.checkunfinished(repo)
+        cmdutil.bailifchanged(repo)
 
     if ui.configbool('commands', 'rebase.requiredest') and not destf:
         raise error.Abort(_('you must specify a destination'),