300 return None |
300 return None |
301 if not merge: |
301 if not merge: |
302 self.transplants.set(n, node) |
302 self.transplants.set(n, node) |
303 |
303 |
304 return n |
304 return n |
|
305 |
|
306 def canresume(self): |
|
307 return os.path.exists(os.path.join(self.path, 'journal')) |
305 |
308 |
306 def resume(self, repo, source, opts): |
309 def resume(self, repo, source, opts): |
307 '''recover last transaction and apply remaining changesets''' |
310 '''recover last transaction and apply remaining changesets''' |
308 if os.path.exists(os.path.join(self.path, 'journal')): |
311 if os.path.exists(os.path.join(self.path, 'journal')): |
309 n, node = self.recover(repo, source, opts) |
312 n, node = self.recover(repo, source, opts) |
625 # deprecated config: transplant.filter |
628 # deprecated config: transplant.filter |
626 opts['filter'] = ui.config('transplant', 'filter') |
629 opts['filter'] = ui.config('transplant', 'filter') |
627 |
630 |
628 tp = transplanter(ui, repo, opts) |
631 tp = transplanter(ui, repo, opts) |
629 |
632 |
630 cmdutil.checkunfinished(repo) |
|
631 p1, p2 = repo.dirstate.parents() |
633 p1, p2 = repo.dirstate.parents() |
632 if len(repo) > 0 and p1 == revlog.nullid: |
634 if len(repo) > 0 and p1 == revlog.nullid: |
633 raise error.Abort(_('no revision checked out')) |
635 raise error.Abort(_('no revision checked out')) |
634 if not opts.get('continue'): |
636 if opts.get('continue'): |
|
637 if not tp.canresume(): |
|
638 raise error.Abort(_('no transplant to continue')) |
|
639 else: |
|
640 cmdutil.checkunfinished(repo) |
635 if p2 != revlog.nullid: |
641 if p2 != revlog.nullid: |
636 raise error.Abort(_('outstanding uncommitted merges')) |
642 raise error.Abort(_('outstanding uncommitted merges')) |
637 m, a, r, d = repo.status()[:4] |
643 m, a, r, d = repo.status()[:4] |
638 if m or a or r or d: |
644 if m or a or r or d: |
639 raise error.Abort(_('outstanding local changes')) |
645 raise error.Abort(_('outstanding local changes')) |