Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 11775:a8614c5a5e9a
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.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Thu, 15 Jul 2010 18:10:05 +0200 |
parents | 55a2af02e45c |
children | 77bbeafd7519 |
comparison
equal
deleted
inserted
replaced
11774:91c4e6d2c9e5 | 11775:a8614c5a5e9a |
---|---|
73 p = p[:-1] | 73 p = p[:-1] |
74 return [changectx(self._repo, x) for x in p] | 74 return [changectx(self._repo, x) for x in p] |
75 | 75 |
76 @propertycache | 76 @propertycache |
77 def substate(self): | 77 def substate(self): |
78 return subrepo.state(self) | 78 return subrepo.state(self, self._repo.ui) |
79 | 79 |
80 def __contains__(self, key): | 80 def __contains__(self, key): |
81 return key in self._manifest | 81 return key in self._manifest |
82 | 82 |
83 def __getitem__(self, key): | 83 def __getitem__(self, key): |