tests/test-subrepo-paths.out
author Martin Geisler <mg@lazybytes.net>
Thu, 15 Jul 2010 18:10:05 +0200
changeset 11775 a8614c5a5e9a
permissions -rw-r--r--
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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11775
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     1
% hg debugsub with no remapping
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     2
path sub
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     3
 source   http://example.net/libfoo
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     4
 revision 
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     5
% hg debugsub with remapping
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     6
path sub
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     7
 source   ssh://localhost/libfoo
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     8
 revision 
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     9
% test bad subpaths pattern
a8614c5a5e9a subrepos: support remapping of .hgsub source paths
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    10
abort: bad subrepository pattern in $HGTMP/test-subrepo-paths/outer/.hg/hgrc:2: invalid group reference