init: mercurial creates directories higher up than reporoot?

Adrian Buehlmann adrian at cadifra.com
Mon Aug 22 04:42:55 CDT 2011


Is this wanted (aka correct) behavior?

  $ hg version -q
  Mercurial Distributed SCM (version 1.9.1+30-c019df62de45)

In an empty dir:

  $ dir
   Volume in drive C has no label.
   Volume Serial Number is F80E-0A52

   Directory of C:\Users\adi\hgrepos\test3

  22.08.2011  11:32    <DIR>          .
  22.08.2011  11:32    <DIR>          ..
                 0 File(s)              0 bytes
                 2 Dir(s)  381'472'583'680 bytes free

Let's do:

  $ hg init foo/bar/bla

Huh?

Let's see:

  $ dir
   Volume in drive C has no label.
   Volume Serial Number is F80E-0A52

   Directory of C:\Users\adi\hgrepos\test3

  22.08.2011  11:33    <DIR>          .
  22.08.2011  11:33    <DIR>          ..
  22.08.2011  11:33    <DIR>          foo
                 0 File(s)              0 bytes
                 3 Dir(s)  381'472'583'680 bytes free

  $ cd foo

  $ cd bar

  $ dir
   Volume in drive C has no label.
   Volume Serial Number is F80E-0A52

   Directory of C:\Users\adi\hgrepos\test3\foo\bar

  22.08.2011  11:33    <DIR>          .
  22.08.2011  11:33    <DIR>          ..
  22.08.2011  11:33    <DIR>          bla
                 0 File(s)              0 bytes
                 3 Dir(s)  381'472'583'680 bytes free

So Mercurial created not just the repo root directory "bla", but also
the missing foo/bar.

Shouldn't it be something like:

  $ hg init foo/bar/bla
  abort: The system cannot find the path specified: foo/bar


More information about the Mercurial-devel mailing list