Mercurial > hg-stable
changeset 20334:205599e31870 stable
record: use absolute path instead of os.chdir
Record was changing the current directory to `repo.root` in order to be able to
feed `command.commit` file name relative to this `repo.root`. This is a bit
overkill and prevent an incoming fix to rebase. This would also break
multi-threaded usage.
Instead we just feed `command.commit` with absolute path name. works as well as
before but without chdir.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Fri, 31 Jan 2014 14:52:53 -0800 |
parents | fa6cb300ded4 |
children | e40520642e64 |
files | hgext/record.py |
diffstat | 1 files changed, 2 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/record.py Wed Jan 29 15:16:36 2014 +0100 +++ b/hgext/record.py Fri Jan 31 14:52:53 2014 -0800 @@ -601,12 +601,8 @@ # it is important to first chdir to repo root -- we'll call # a highlevel command with list of pathnames relative to # repo root - cwd = os.getcwd() - os.chdir(repo.root) - try: - commitfunc(ui, repo, *newfiles, **opts) - finally: - os.chdir(cwd) + newfiles = [repo.wjoin(nf) for nf in newfiles] + commitfunc(ui, repo, *newfiles, **opts) return 0 finally: