view tests/test-convert-splicemap @ 10674:6d87c20cd7a8 stable

hgweb: fix broken URLs of RSS/Atom feeds (issue1772) This fixes doubled URL, e.g. http://example.orghttp://example.org/..., which appears on RSS/Atom feeds served by hgwebdir. It splits baseurl to update SERVER_NAME, SERVER_PORT and SCRIPT_NAME, according to RFC 3875. Updated the test output since SCRIPT_NAME becomes not to contain http://host:port part.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 11 Mar 2010 00:28:27 +0900
parents bb5ea66789e3
children
line wrap: on
line source

#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "convert=" >> $HGRCPATH
echo 'graphlog =' >> $HGRCPATH

glog()
{
    hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
}

hg init repo1
cd repo1
echo a > a
hg ci -Am adda
echo b > b
echo a >> a
hg ci -Am addb
PARENTID1=`hg id --debug -i`
echo c > c
hg ci -Am addc
PARENTID2=`hg id --debug -i`
cd ..

hg init repo2
cd repo2
echo b > a
echo d > d
hg ci -Am addaandd
CHILDID1=`hg id --debug -i`
echo d >> d
hg ci -Am changed
CHILDID2=`hg id --debug -i`
echo e > e
hg ci -Am adde
cd ..

echo '% test invalid splicemap'
cat > splicemap <<EOF
$CHILDID2
EOF
hg convert --splicemap splicemap repo2 repo1

echo '% splice repo2 on repo1'
cat > splicemap <<EOF
$CHILDID1 $PARENTID1
$CHILDID2 $PARENTID2,$CHILDID1
EOF
hg clone repo1 target1
hg convert --splicemap splicemap repo2 target1
glog -R target1