[PATCH] init: expand configured paths

Martin Geisler mg at lazybytes.net
Sun Aug 15 04:24:18 CDT 2010


Mads Kiilerich <mads at kiilerich.com> writes:

>  Augie Fackler wrote, On 08/14/2010 09:31 PM:
>>
>> On Aug 14, 2010, at 12:02 PM, Mads Kiilerich wrote:
>>
>>> Martin Geisler wrote, On 08/14/2010 05:42 PM:
>>>> Right now the argument to 'hg init' is a local path
>>>
>>> (no, it is a url that can be local or remote)
>>
>> I agree with mg:
>>
>> [imladris:~] augie% hg init http://bitbucket.org/durin42/foo
>> abort: cannot create new http repository
>
> $ hg init ssh://localhost//tmp/repo
> $ ll -d /tmp/repo/.hg/
> drwxrwxr-x 3 mk mk 4096 Aug 14 23:00 /tmp/repo/.hg/

Hmm, I was not aware you could do that. I knew you could clone to a SSH
target, but I've somehow always seen that as a special case.

> $ hg showconfig|grep repo
> paths.repo=http://some.where/repo
> $ hg clone hg repo
> abort: cannot create new http repository
>
>> 'hg init' is a local operation, and having it work on [paths] entries
>> seems like a misfeature to me.
>
> "hg help init" sayz:
>
>     It is possible to specify an "ssh://" URL as the destination. See
> "hg help urls" for more information.
>
> "hg help urls" sayz:
>     These URLs can all be stored in your hgrc with path aliases under
> the [paths] section ...
>     You can then use the alias for any command that uses a URL ...
>
>
> FWIW I really don't understand your reasoning for why init shouldn't
> do what the help implies that it does

Perhaps we don't care that much what the help says? What is important is
what the command means, and to me it means 'create a new repository here
with this name'.

One nice think about your patch is that one can create a local
repository, configure paths.default and then do 'hg clone . default'.
Today this creates a directory called 'default'.

I don't know, but perhaps I would like this more if we have support for
creating repositories over HTTP.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100815/c42fa31e/attachment.pgp>


More information about the Mercurial-devel mailing list