diff hgext/rebase.py @ 42583:b9bc47211cf5

abort: added support for rebase This adds support of `rebase` to `hg abort` plan. An independent abort logic for `rebase` is created under `abortrebase()` function. For this a seperate `rebaseruntime` object is created under the function to handle an unfinished `rebasestate` and abort that using abort logic under `_prepareabortorcontinue`. Results of tests are shown. Differential Revision: https://phab.mercurial-scm.org/D6568
author Taapas Agrawal <taapas2897@gmail.com>
date Sun, 23 Jun 2019 23:11:35 +0530
parents 0231032729c4
children 35ebdbb38efb
line wrap: on
line diff
--- a/hgext/rebase.py	Sun Jun 23 22:31:31 2019 +0530
+++ b/hgext/rebase.py	Sun Jun 23 23:11:35 2019 +0530
@@ -1923,6 +1923,11 @@
         obsoleteextinctsuccessors,
     )
 
+def abortrebase(ui, repo):
+    with repo.wlock(), repo.lock():
+        rbsrt = rebaseruntime(repo, ui)
+        rbsrt._prepareabortorcontinue(isabort=True)
+
 def summaryhook(ui, repo):
     if not repo.vfs.exists('rebasestate'):
         return
@@ -1951,4 +1956,4 @@
                      _("specify merge tool for rebase")))
     cmdutil.summaryhooks.add('rebase', summaryhook)
     statemod.addunfinished('rebase', fname='rebasestate', stopflag=True,
-                            continueflag=True)
+                            continueflag=True, abortfunc=abortrebase)