hgext/transplant.py
changeset 3726 752884db5037
parent 3725 ccc7a9eb0e5e
child 3752 f902f409cd81
equal deleted inserted replaced
3725:ccc7a9eb0e5e 3726:752884db5037
   194         if not patchfile and not merge:
   194         if not patchfile and not merge:
   195             raise util.Abort(_('can only omit patchfile if merging'))
   195             raise util.Abort(_('can only omit patchfile if merging'))
   196         if patchfile:
   196         if patchfile:
   197             try:
   197             try:
   198                 files = {}
   198                 files = {}
   199                 fuzz = patch.patch(patchfile, self.ui, cwd=repo.root,
   199                 try:
   200                                    files=files)
   200                     fuzz = patch.patch(patchfile, self.ui, cwd=repo.root,
   201                 if not files:
   201                                        files=files)
   202                     self.ui.warn(_('%s: empty changeset') % revlog.hex(node))
   202                     if not files:
   203                     return
   203                         self.ui.warn(_('%s: empty changeset') % revlog.hex(node))
   204                 files = patch.updatedir(self.ui, repo, files, wlock=wlock)
   204                         return
       
   205                 finally:
       
   206                     files = patch.updatedir(self.ui, repo, files, wlock=wlock)
   205                 if filter:
   207                 if filter:
   206                     os.unlink(patchfile)
   208                     os.unlink(patchfile)
   207             except Exception, inst:
   209             except Exception, inst:
   208                 if filter:
   210                 if filter:
   209                     os.unlink(patchfile)
   211                     os.unlink(patchfile)