diff hgext/transplant.py @ 42717:0a4303c77637

continue: added support for transplant This creates a seperate function `continuetransplant()` containing logic for resuming transplant from interrupted state. `continuetransplant()` is then registered as `continuefunc` for state detection API. Results are shown in tests. Differential Revision: https://phab.mercurial-scm.org/D6689
author Taapas Agrawal <taapas2897@gmail.com>
date Wed, 24 Jul 2019 18:32:36 +0530
parents 12243f15d53e
children ac6121a24f27
line wrap: on
line diff
--- a/hgext/transplant.py	Fri Aug 09 05:09:54 2019 -0400
+++ b/hgext/transplant.py	Wed Jul 24 18:32:36 2019 +0530
@@ -734,6 +734,13 @@
         if cleanupfn:
             cleanupfn()
 
+def continuecmd(ui, repo):
+    """logic to resume an interrupted transplant using
+    'hg continue'"""
+    with repo.wlock():
+        tp = transplanter(ui, repo, {})
+        return tp.resume(repo, repo, {})
+
 revsetpredicate = registrar.revsetpredicate()
 
 @revsetpredicate('transplanted([set])')
@@ -760,6 +767,7 @@
 def extsetup(ui):
     statemod.addunfinished (
         'transplant', fname='transplant/journal', clearable=True,
+        continuefunc=continuecmd,
         statushint=_('To continue:    hg transplant --continue\n'
                      'To abort:       hg update'),
         cmdhint=_("use 'hg transplant --continue' or 'hg update' to abort")