tests: unify test-subrepo-paths

This commit is contained in:
Martin Geisler 2010-08-17 16:52:42 +02:00
parent 7cbf3336a2
commit ddb79b6591
3 changed files with 35 additions and 37 deletions

View File

@ -1,27 +0,0 @@
#!/bin/sh
hg init outer
cd outer
echo 'sub = http://example.net/libfoo' > .hgsub
hg add .hgsub
echo '% hg debugsub with no remapping'
hg debugsub
cat > .hg/hgrc <<EOF
[subpaths]
http://example.net = ssh://localhost
EOF
echo '% hg debugsub with remapping'
hg debugsub
echo '% test bad subpaths pattern'
cat > .hg/hgrc <<EOF
[subpaths]
.* = \1
EOF
hg debugsub 2>&1 | "$TESTDIR/filtertmp.py"
exit 0

View File

@ -1,10 +0,0 @@
% hg debugsub with no remapping
path sub
source http://example.net/libfoo
revision
% hg debugsub with remapping
path sub
source ssh://localhost/libfoo
revision
% test bad subpaths pattern
abort: bad subrepository pattern in $HGTMP/test-subrepo-paths/outer/.hg/hgrc:2: invalid group reference

View File

@ -0,0 +1,35 @@
$ hg init outer
$ cd outer
$ echo 'sub = http://example.net/libfoo' > .hgsub
$ hg add .hgsub
hg debugsub with no remapping
$ hg debugsub
path sub
source http://example.net/libfoo
revision
$ cat > .hg/hgrc <<EOF
> [subpaths]
> http://example.net = ssh://localhost
> EOF
hg debugsub with remapping
$ hg debugsub
path sub
source ssh://localhost/libfoo
revision
test bad subpaths pattern
$ cat > .hg/hgrc <<EOF
> [subpaths]
> .* = \1
> EOF
$ hg debugsub
abort: bad subrepository pattern in .*/test-subrepo-paths.t/outer/.hg/hgrc:2: invalid group reference
$ exit 0