# HG changeset patch # User timeless # Date 1452056361 0 # Node ID 128ef8828ed58b61bb3d3502f5f52b65828008a9 # Parent 1c48f348f2d0860ad36ca1731e46ede51488e8de transplant: only use checkunfinished if not continue diff -r 1c48f348f2d0 -r 128ef8828ed5 hgext/transplant.py --- 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] diff -r 1c48f348f2d0 -r 128ef8828ed5 tests/test-transplant.t --- a/tests/test-transplant.t Tue Jan 05 22:46:04 2016 +0000 +++ b/tests/test-transplant.t Wed Jan 06 04:59:21 2016 +0000 @@ -410,6 +410,9 @@ $ hg up -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm added + $ hg transplant --continue + abort: no transplant to continue + [255] $ hg transplant 1 applying 46ae92138f3c patching file foo