# HG changeset patch # User Mads Kiilerich # Date 2010-07-21 17:29:57 # Node ID c3e8ab80ee90d5adf083f08ae65e520737c6498e # Parent a0c5f531daab85ae415ee59c3b5f9f6356e141b6 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. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -42,7 +42,7 @@ class localrepository(repo.repository): 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): diff --git a/tests/test-init b/tests/test-init --- a/tests/test-init +++ b/tests/test-init @@ -84,3 +84,6 @@ for i in bundle file hg http https old-h 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 diff --git a/tests/test-init.out b/tests/test-init.out --- a/tests/test-init.out +++ b/tests/test-init.out @@ -73,3 +73,9 @@ ok ok # hg init "with space" ok +# creating 'local/sub/repo' +store created +00changelog.i created +revlogv1 +store +fncache