hgext/transplant.py
changeset 27677 128ef8828ed5
parent 27676 1c48f348f2d0
child 27678 b97004648028
--- a/hgext/transplant.py	Tue Jan 05 22:46:04 2016 +0000
+++ b/hgext/transplant.py	Wed Jan 06 04:59:21 2016 +0000
@@ -303,6 +303,9 @@
 
         return n
 
+    def canresume(self):
+        return os.path.exists(os.path.join(self.path, 'journal'))
+
     def resume(self, repo, source, opts):
         '''recover last transaction and apply remaining changesets'''
         if os.path.exists(os.path.join(self.path, 'journal')):
@@ -627,11 +630,14 @@
 
     tp = transplanter(ui, repo, opts)
 
-    cmdutil.checkunfinished(repo)
     p1, p2 = repo.dirstate.parents()
     if len(repo) > 0 and p1 == revlog.nullid:
         raise error.Abort(_('no revision checked out'))
-    if not opts.get('continue'):
+    if opts.get('continue'):
+        if not tp.canresume():
+            raise error.Abort(_('no transplant to continue'))
+    else:
+        cmdutil.checkunfinished(repo)
         if p2 != revlog.nullid:
             raise error.Abort(_('outstanding uncommitted merges'))
         m, a, r, d = repo.status()[:4]