Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 2760:e6bef16b6cec
import: make patch apply if run in subdir
fix is same as for mq patch. patch apply code should be merged.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Tue, 01 Aug 2006 15:51:13 -0700 |
parents | 6c2c10cedf7a |
children | 0aa458261901 |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Aug 02 00:20:28 2006 +0200 +++ b/mercurial/commands.py Tue Aug 01 15:51:13 2006 -0700 @@ -1832,9 +1832,13 @@ if not diffs_seen: raise util.Abort(_('no diffs found')) - files = util.patch(strip, tmpname, ui) + files = util.patch(strip, tmpname, ui, cwd=repo.root) if len(files) > 0: - addremove_lock(ui, repo, files, {}) + cfiles = files + cwd = repo.getcwd() + if cwd: + cfiles = [util.pathto(cwd, f) for f in files] + addremove_lock(ui, repo, cfiles, {}) repo.commit(files, message, user, date) finally: os.unlink(tmpname)