init: create target directory recursively stable
authorMads Kiilerich <mads@kiilerich.com>
Wed, 21 Jul 2010 19:29:57 +0200
branchstable
changeset 11640 c3e8ab80ee90
parent 11639 a0c5f531daab
child 11641 ead7550f1aab
init: create target directory recursively Subrepos with relative paths must often be cloned to locations deep in the directory structure. This allows clone over ssh (init+push) work.
mercurial/localrepo.py
tests/test-init
tests/test-init.out
--- a/mercurial/localrepo.py	Wed Jul 21 17:51:37 2010 +0200
+++ b/mercurial/localrepo.py	Wed Jul 21 19:29:57 2010 +0200
@@ -42,7 +42,7 @@
         if not os.path.isdir(self.path):
             if create:
                 if not os.path.exists(path):
-                    os.mkdir(path)
+                    util.makedirs(path)
                 os.mkdir(self.path)
                 requirements = ["revlogv1"]
                 if self.ui.configbool('format', 'usestore', True):
--- a/tests/test-init	Wed Jul 21 17:51:37 2010 +0200
+++ b/tests/test-init	Wed Jul 21 19:29:57 2010 +0200
@@ -84,3 +84,6 @@
   test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
 done
 
+echo "# creating 'local/sub/repo'"
+hg init local/sub/repo
+checknewrepo local/sub/repo
--- a/tests/test-init.out	Wed Jul 21 17:51:37 2010 +0200
+++ b/tests/test-init.out	Wed Jul 21 19:29:57 2010 +0200
@@ -73,3 +73,9 @@
 ok
 # hg init "with space"
 ok
+# creating 'local/sub/repo'
+store created
+00changelog.i created
+revlogv1
+store
+fncache