subrepos: support remapping of .hgsub source paths
Given a .hgsub file containing
lib/libfoo = http://server/libfoo
the 'lib/libfoo' subrepo will be cloned from 'http://server/libfoo'.
This changeset introduces a remapping mechanism whereby the source
paths (the right-hand sides) in the .hgsub file can be remapped. This
subpaths section
[subpaths]
http://server = /local
will result in the 'lib/libfoo' subrepo being cloned from
'/local/libfoo' instead of from 'http://server/libfoo'.
The patterns (left-hand sides) are really regular expressions and the
replacement strings (right-hand sides) can refer to matched groups
using normal backreferences. This can be used for more complicated
replacements such as
[subpaths]
http://server/(.*)-hg/ = http://hg.server/\1/
which replaces 'http://server/foo-hg/' with 'http://hg.server/foo/'.
All patterns are applied in the order by which they are listed in the
config files.
.. Common link and substitution definitions.
.. |hg(1)| replace:: **hg**\ (1)
.. _hg(1): hg.1.html
.. |hgrc(5)| replace:: **hgrc**\ (5)
.. _hgrc(5): hgrc.5.html
.. |hgignore(5)| replace:: **hgignore**\ (5)
.. _hgignore(5): hgignore.5.html