Mercurial > public > mercurial-scm > hg-stable
diff hgext/transplant.py @ 3726:752884db5037
transplant: recover added/removed files after failed application
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Thu, 30 Nov 2006 13:51:58 -0800 |
parents | ccc7a9eb0e5e |
children | f902f409cd81 |
line wrap: on
line diff
--- a/hgext/transplant.py Thu Nov 30 11:32:40 2006 -0800 +++ b/hgext/transplant.py Thu Nov 30 13:51:58 2006 -0800 @@ -196,12 +196,14 @@ if patchfile: try: files = {} - fuzz = patch.patch(patchfile, self.ui, cwd=repo.root, - files=files) - if not files: - self.ui.warn(_('%s: empty changeset') % revlog.hex(node)) - return - files = patch.updatedir(self.ui, repo, files, wlock=wlock) + try: + fuzz = patch.patch(patchfile, self.ui, cwd=repo.root, + files=files) + if not files: + self.ui.warn(_('%s: empty changeset') % revlog.hex(node)) + return + finally: + files = patch.updatedir(self.ui, repo, files, wlock=wlock) if filter: os.unlink(patchfile) except Exception, inst: