Mercurial > hg
comparison hgext/mq.py @ 14260:00a881581400
patch: make patch()/internalpatch() always update the dirstate
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 08 May 2011 17:48:31 +0200 |
parents | df9ccd39828c |
children | 6332c02b3d68 |
comparison
equal
deleted
inserted
replaced
14259:df9ccd39828c | 14260:00a881581400 |
---|---|
612 def patch(self, repo, patchfile): | 612 def patch(self, repo, patchfile): |
613 '''Apply patchfile to the working directory. | 613 '''Apply patchfile to the working directory. |
614 patchfile: name of patch file''' | 614 patchfile: name of patch file''' |
615 files = {} | 615 files = {} |
616 try: | 616 try: |
617 try: | 617 fuzz = patchmod.patch(self.ui, repo, patchfile, strip=1, |
618 fuzz = patchmod.patch(patchfile, self.ui, strip=1, | 618 cwd=repo.root, files=files, eolmode=None) |
619 cwd=repo.root, files=files, eolmode=None) | 619 return (True, list(files), fuzz) |
620 finally: | |
621 files = patchmod.updatedir(self.ui, repo, files) | |
622 return (True, files, fuzz) | |
623 except Exception, inst: | 620 except Exception, inst: |
624 self.ui.note(str(inst) + '\n') | 621 self.ui.note(str(inst) + '\n') |
625 if not self.ui.verbose: | 622 if not self.ui.verbose: |
626 self.ui.warn(_("patch failed, unable to continue (try -v)\n")) | 623 self.ui.warn(_("patch failed, unable to continue (try -v)\n")) |
627 return (False, files, False) | 624 return (False, list(files), False) |
628 | 625 |
629 def apply(self, repo, series, list=False, update_status=True, | 626 def apply(self, repo, series, list=False, update_status=True, |
630 strict=False, patchdir=None, merge=None, all_files=None): | 627 strict=False, patchdir=None, merge=None, all_files=None): |
631 wlock = lock = tr = None | 628 wlock = lock = tr = None |
632 try: | 629 try: |