[PATCH stable] init: create target directory recursively

Nicolas Dumazet nicdumz at gmail.com
Thu Jul 22 01:20:31 CDT 2010


On Wed, 21 Jul 2010 19:31:00 +0200
Mads Kiilerich <mads at kiilerich.com> wrote:

> # HG changeset patch
> # User Mads Kiilerich <mads at kiilerich.com>
> # Date 1279733397 -7200
> # Node ID a51cc1debab83e5b1b79d5176cce2561c668e4a0
> # Parent  c2347f4d9b2c875111d4fe0c8f393e26a20e13d2
> 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.

Thanks!
In stable, c3e8ab80ee90.

-Nicolas.

> 
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -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):
> diff --git a/tests/test-init b/tests/test-init
> --- a/tests/test-init
> +++ b/tests/test-init
> @@ -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
> 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
>  # hg init "with space"
>  ok
> +# creating 'local/sub/repo'
> +store created
> +00changelog.i created
> +revlogv1
> +store
> +fncache
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Nicolas Dumazet — NicDumZ


More information about the Mercurial-devel mailing list