Patchwork D3827: rebase: no need to store backup during dry-run while aborting

login
register
mail settings
Submitter phabricator
Date June 22, 2018, 5:10 p.m.
Message ID <a2faf9c4cce742786a65e820ff463abc@localhost.localdomain>
Download mbox | patch
Permalink /patch/32384/
State Not Applicable
Headers show

Comments

phabricator - June 22, 2018, 5:10 p.m.
khanchi97 updated this revision to Diff 9260.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3827?vs=9256&id=9260

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS




To: khanchi97, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -212,7 +212,6 @@ 
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   there will be no conflict, you can rebase
-  saved backup bundle to $TESTTMP/repo1/repo2/skrepo/.hg/strip-backup/c83b1da5b1ae-f1e0beb9-backup.hg
   rebase aborted
 
   $ hg diff
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -325,7 +325,7 @@ 
         skippedset.update(obsoleteextinctsuccessors)
         _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
-    def _prepareabortorcontinue(self, isabort):
+    def _prepareabortorcontinue(self, isabort, nobackup=False):
         try:
             self.restorestatus()
             self.collapsemsg = restorecollapsemsg(self.repo, isabort)
@@ -341,8 +341,8 @@ 
                 hint = _('use "hg rebase --abort" to clear broken state')
                 raise error.Abort(msg, hint=hint)
         if isabort:
-            return abort(self.repo, self.originalwd, self.destmap,
-                         self.state, activebookmark=self.activebookmark)
+            return abort(self.repo, self.originalwd, self.destmap, self.state,
+                         activebookmark=self.activebookmark, nobackup=nobackup)
 
     def _preparenewrebase(self, destmap):
         if not destmap:
@@ -828,7 +828,7 @@ 
         else:
             ui.status(_('there will be no conflict, you can rebase\n'))
         finally:
-            _origrebase(ui, repo, abort=True)
+            _origrebase(ui, repo, abort=True, nobackup=True)
     elif inmemory:
         try:
             # in-memory merge doesn't support conflicts, so if we hit any, abort
@@ -859,6 +859,7 @@ 
         destspace = opts.get('_destspace')
         contf = opts.get('continue')
         abortf = opts.get('abort')
+        nobackup = opts.get('nobackup')
         if opts.get('interactive'):
             try:
                 if extensions.find('histedit'):
@@ -889,7 +890,7 @@ 
                 ms = mergemod.mergestate.read(repo)
                 mergeutil.checkunresolved(ms)
 
-            retcode = rbsrt._prepareabortorcontinue(abortf)
+            retcode = rbsrt._prepareabortorcontinue(abortf, nobackup=nobackup)
             if retcode is not None:
                 return retcode
         else:
@@ -1543,7 +1544,7 @@ 
 
     return False
 
-def abort(repo, originalwd, destmap, state, activebookmark=None):
+def abort(repo, originalwd, destmap, state, activebookmark=None, nobackup=False):
     '''Restore the repository to its original state.  Additional args:
 
     activebookmark: the name of the bookmark that should be active after the
@@ -1588,7 +1589,10 @@ 
 
             # Strip from the first rebased revision
             if rebased:
-                repair.strip(repo.ui, repo, strippoints)
+                if nobackup:
+                    repair.strip(repo.ui, repo, strippoints, backup=False)
+                else:
+                    repair.strip(repo.ui, repo, strippoints)
 
         if activebookmark and activebookmark in repo._bookmarks:
             bookmarks.activate(repo, activebookmark)