changeset 10:18c1e7ac0012

Fix so "hg -R <repo> fastimport ..." works (write files under repo.root, not current dir).
author Greg Ward <greg-hg@gerg.ca>
date Tue, 31 Mar 2009 21:05:08 -0400
parents 7e3d7dbe3386
children 9e9c215fcbd8
files fastimport/hgimport.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/fastimport/hgimport.py	Tue Mar 31 10:10:04 2009 -0400
+++ b/fastimport/hgimport.py	Tue Mar 31 21:05:08 2009 -0400
@@ -141,10 +141,11 @@
         #print "============================" + filecmd.path
         # FIXME: handle mode
         self.files.add(filecmd.path)
-        self._make_container(filecmd.path)
+        fullpath = os.path.join(self.repo.root, filecmd.path)
+        self._make_container(fullpath)
         #print "made dirs, writing file"
-        f = open(filecmd.path, "w")
         f.write(filecmd.data)
+        f = open(fullpath, "w")
         f.close()
         #print self.repo.add([filecmd.path])
         #print "Done:", filecmd.path