hgext/transplant.py
changeset 3726 752884db5037
parent 3725 ccc7a9eb0e5e
child 3752 f902f409cd81
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -196,12 +196,14 @@ class transplanter:
         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: