changeset 101:af245f45c93d

hg2.9-compat: fix crecord from sub directory Mercurial is now caching current working directory path. This broke record and this also broke crecord that used the same code. We now use explicite path when committing file instead of changeing working directory. This is cleaner anyway.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 13 Mar 2014 21:23:31 -0700
parents 8f8467e38202
children c44e2c19caaa
files crecord/crecord_core.py
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/crecord/crecord_core.py
+++ b/crecord/crecord_core.py
@@ -161,12 +161,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(n) for n in newfiles]
+            commitfunc(ui, repo, *newfiles, **opts)
 
             return 0
         finally: