comparison 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
comparison
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)