# HG changeset patch # User Patrick Mezard # Date 1305837841 -7200 # Node ID 2d16f15da7bda359883fe7e875de347198a4f317 # Parent d4192500586a1f73d1cfc719c2eeab3035daaacb patch: remove patch.patch() cwd argument diff -r d4192500586a -r 2d16f15da7bd hgext/mq.py --- a/hgext/mq.py Thu May 19 22:44:01 2011 +0200 +++ b/hgext/mq.py Thu May 19 22:44:01 2011 +0200 @@ -620,7 +620,7 @@ files = {} try: fuzz = patchmod.patch(self.ui, repo, patchfile, strip=1, - cwd=repo.root, files=files, eolmode=None) + files=files, eolmode=None) return (True, list(files), fuzz) except Exception, inst: self.ui.note(str(inst) + '\n') diff -r d4192500586a -r 2d16f15da7bd hgext/transplant.py --- a/hgext/transplant.py Thu May 19 22:44:01 2011 +0200 +++ b/hgext/transplant.py Thu May 19 22:44:01 2011 +0200 @@ -227,8 +227,7 @@ if patchfile: try: files = {} - patch.patch(self.ui, repo, patchfile, cwd=repo.root, - files=files, eolmode=None) + patch.patch(self.ui, repo, patchfile, files=files, eolmode=None) files = list(files) if not files: self.ui.warn(_('%s: empty changeset') % revlog.hex(node)) diff -r d4192500586a -r 2d16f15da7bd mercurial/commands.py --- a/mercurial/commands.py Thu May 19 22:44:01 2011 +0200 +++ b/mercurial/commands.py Thu May 19 22:44:01 2011 +0200 @@ -3105,8 +3105,8 @@ repo.dirstate.setbranch(branch or 'default') files = {} - patch.patch(ui, repo, tmpname, strip=strip, cwd=repo.root, - files=files, eolmode=None, similarity=sim / 100.0) + patch.patch(ui, repo, tmpname, strip=strip, files=files, + eolmode=None, similarity=sim / 100.0) files = list(files) if opts.get('no_commit'): if message: diff -r d4192500586a -r 2d16f15da7bd mercurial/patch.py --- a/mercurial/patch.py Thu May 19 22:44:01 2011 +0200 +++ b/mercurial/patch.py Thu May 19 22:44:01 2011 +0200 @@ -1281,13 +1281,14 @@ return -1 return err -def _externalpatch(ui, repo, patcher, patchname, strip, cwd, files, +def _externalpatch(ui, repo, patcher, patchname, strip, files, similarity): """use to apply to the working directory. returns whether patch was applied with fuzz factor.""" fuzz = False args = [] + cwd = repo.root if cwd: args.append('-d %s' % util.shellquote(cwd)) fp = util.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, @@ -1355,7 +1356,7 @@ raise PatchError(_('patch failed to apply')) return ret > 0 -def patch(ui, repo, patchname, strip=1, cwd=None, files=None, eolmode='strict', +def patch(ui, repo, patchname, strip=1, files=None, eolmode='strict', similarity=0): """Apply to the working directory. @@ -1374,7 +1375,7 @@ try: if patcher: return _externalpatch(ui, repo, patcher, patchname, strip, - cwd, files, similarity) + files, similarity) return internalpatch(ui, repo, patchname, strip, files, eolmode, similarity) except PatchError, err: