Skip to content
Snippets Groups Projects
Name Last commit Last update
README.txt
path_pattern.py
setup.py
.. -*- mode: rst -*-

======================
Mercurial Path Pattern
======================

``path_pattern`` is a Mercurial_ extension used to define default
remote paths for multiple repositories. Configure it once, then
use ``hg pull yourlovelyalias`` in every repo without the need
to create ``.hg/hgrc``. 


Typical use cases
=====================

Write in your ``~/.hgrc``::

    [extensions]
    path_pattern =

    [path_pattern]
    lagrange.local = ~/devel/{repo}
    lagrange.remote =  ssh://johny@lagrange.mekk.net/sources/{repo}

Then imagine ``~/devel/pymodules/acme`` and ``~/devel/personal/blog/drafts``
are both some mercurial repositories and try::

    cd ~/devel/pymodules/acme
    hg pull lagrange
    # Works, pulls from ssh://johny@lagrange.mekk.net/sources/pymodules/acme

    cd ~/devel/personal/blog/drafts
    hg push lagrange
    # Works, pushes to ssh://johny@lagrange.mekk.net/sources/personal/blog/drafts

Both those work in spite those repositories do not have those paths
defined individually (they may even lack ``.hg/hgrc`` at all).

For two extensions that's not very useful, but whenever you have
hundred of them, managing individual ``.hg/hgrc`` becomes a hassle
(imaginge changing ``lagrange.mekk.net`` to ``lagrange.mekk.com`` everywhere,
or maybe adding second remote alias for new development machine).

Path patterns have lower priority than per-repository paths, so in case
you define ``lagrange`` path in some repo, it will win.

Additional commands
=====================

Extension mostly works behind the courtains, making standard commands
like ``pull``, ``push``and ``incoming`` aware of extra paths.
Still, there are some embedded commands:

TODO (pattern_paths)

Pattern syntax
=====================

TODO


Implementation details
======================


TODO

Development
===========

Development is tracked on BitBucket, see 
http://bitbucket.org/Mekk/mercurial_path_pattern/


Additional notes
================

Information about this extension is also available
on Mercurial Wiki: http://mercurial.selenic.com/wiki/PathPatternExtension