[PATCH] init: expand configured paths

Augie Fackler durin42 at gmail.com
Sat Aug 14 14:31:58 CDT 2010


On Aug 14, 2010, at 12:02 PM, Mads Kiilerich wrote:

> Martin Geisler wrote, On 08/14/2010 05:42 PM:
>> Mads Kiilerich<mads at kiilerich.com>  writes:
>>
>>> # HG changeset patch
>>> # User Mads Kiilerich<mads at kiilerich.com>
>>> # Date 1281308426 -7200
>>> # Node ID 374d15fead75dd0892d2cd665c7f6ab8b993ad91
>>> # Parent  fc8dc1afd52f339dc8471ecbec29a50fb21566f2
>>> init: expand configured paths
>>>
>>> Most commands expands configured paths when repositories are
>>> specified. Clone also expands the destination path (even though it
>>> doesn't contain a repository yet). This makes init do the same.
>> I don't think this is a good idea. I see the paths as shortcuts for
>> pushing and pulling (and thus also cloning) but not as something we
>> should expand in other situations.
>
> "hg help paths" says that it will "show aliases for remote  
> repositories".
>
> (I don't think "remote" is correct/helpful here and it would be  
> better if it was left out. "other" could be better, but still  
> doesn't make sense when it is used as a global command ...)
>
> The help text further says that default/default-push is special for  
> push/pull, but it doesn't support your interpretation that paths is  
> for push/pull only.
>
>
> "hg help urls" (referenced from "hg -h init") explicitly says about  
> paths: "You can then use the alias for any command that uses a URL"
>
>
> Exceptions increases the complexity - why not make Mercurial more  
> consistent and meet the users fair expectations?
>
> Considering that clone can be described as init+push I think it is  
> confusing that clone and push expand paths in the destination while  
> init doesn't.
>
>> 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' is a local operation, and having it work on [paths] entries  
seems like a misfeature to me.

>
>> and I think it would
>> be confusing if 'hg init crew' would try to initialize a repository
>> somewhere else than in my current directory, but because I may have
>> defined a 'crew = ...' path in my ~/.hgrc.
>
> Yes, aliases can be confusing (though not as much as defaults ;-) ),  
> but when they are configured they do what they do and that is very  
> convenient.
>
> Do you have the same objections to the fact that clone expands paths  
> in the target directory? (Considering "hg init crew" vs "hg clone  
> ~kurt/crew crew")
>
>
> Ok; if you fix the documentation and clone then I will rest my  
> case! ;-)
>
> /Mads
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list