Path Pattern extension

Marcin Kasperski Marcin.Kasperski at mekk.waw.pl
Sun Oct 11 20:20:38 UTC 2015


As I understand path_pattern is somewhat orthogonal to schemes extension.

Schemes is about making urls easier to write (and less error prone) by
hand, and particularly useful for „I make ad-hoc clones from central
server without keeping much structure”. bb://name to clone from
bitbucket looks like the most illustrative example. Schemes urls live
on command prompt or in .hg/hgrc

Path_pattern main usage case is keeping structured repository trees
synchronized between a few machines. It's main usage case is „I have 2
or maybe 3 machines on which I develop, wherever I sit and whatever I
do I want to be able to hg push othermachinealias”. Path_pattern urls
live in ~/.hgrc or maybe even /etc/mercurial.

Or, technically, schemes is about path syntax while path pattern is
about path definition propagation.

Those two may happily cooperate (I haven't tested it, but path_pattern
should gladily propagate schemes-type paths), but in general I feel
those solve different (albeit related) needs. People may use both, or
may use just one of them.

On Sun, Oct 11, 2015 at 9:49 PM, Pierre-Yves David
<pierre-yves.david at ens-lyon.org> wrote:
>
>
> On 10/11/2015 05:44 AM, Marcin Kasperski wrote:
>>
>> I found managing myriads of .hg/hgrc files just to add [paths]
>> to be rather painful, so I wrote the extension to make task
>> unnecessary in typical cases (where repo trees are similarly
>> layed out on multiple machines):
>
>
> That is pretty cool, would you consider contribute this to the scheme
> extension?
>
>
>>
>>     https://bitbucket.org/Mekk/mercurial-path_pattern
>>
>> In short:
>>
>> 1. Write in ~/.hgrc
>>
>>      [extensions]
>>      path_pattern =
>>
>>      [path_pattern]
>>      lagrange.local = ~/devel/{repo}
>>      lagrange.remote =  ssh://johny@lagrange.mekk.net/sources/{repo}
>>
>> 2. From this very moment alias lagrange is known to all mercurial
>> repos beneath ~/devel. For example
>>
>>      cd ~/devel/pymodules/acme
>>           # Let's say this is some repo
>>      hg pull lagrange
>>           # pulls from
>> ssh://johny@lagrange.mekk.net/sources/pymodules/acme
>
>
>
> --
> Pierre-Yves David



More information about the Mercurial mailing list