406 return (0, head) |
406 return (0, head) |
407 |
407 |
408 def patch(self, repo, patchfile): |
408 def patch(self, repo, patchfile): |
409 '''Apply patchfile to the working directory. |
409 '''Apply patchfile to the working directory. |
410 patchfile: file name of patch''' |
410 patchfile: file name of patch''' |
|
411 files = {} |
411 try: |
412 try: |
412 (files, fuzz) = patch.patch(patchfile, self.ui, strip=1, |
413 fuzz = patch.patch(patchfile, self.ui, strip=1, cwd=repo.root, |
413 cwd=repo.root) |
414 files=files) |
414 except Exception, inst: |
415 except Exception, inst: |
415 self.ui.note(str(inst) + '\n') |
416 self.ui.note(str(inst) + '\n') |
416 if not self.ui.verbose: |
417 if not self.ui.verbose: |
417 self.ui.warn("patch failed, unable to continue (try -v)\n") |
418 self.ui.warn("patch failed, unable to continue (try -v)\n") |
418 return (False, [], False) |
419 return (False, files, False) |
419 |
420 |
420 return (True, files, fuzz) |
421 return (True, files, fuzz) |
421 |
422 |
422 def apply(self, repo, series, list=False, update_status=True, |
423 def apply(self, repo, series, list=False, update_status=True, |
423 strict=False, patchdir=None, merge=None, wlock=None): |
424 strict=False, patchdir=None, merge=None, wlock=None): |