##// END OF EJS Templates
hg.clone: do not ignore branch argument when source is a repo object...
hg.clone: do not ignore branch argument when source is a repo object This is a revert of 4a70178f9bde. The "bug" mentioned in this changeset is unclear: hopefully using a test to cover this usage should prevent any bugs.

File last commit:

r11818:b1ae33b8 stable
r11818:b1ae33b8 stable
Show More
test-clone
222 lines | 4.0 KiB | text/plain | TextLexer
Thomas Arendsen Hein
Use sh instead of bash in tests.
r834 #!/bin/sh
mpm@selenic.com
[PATCH] Tests for clone command...
r550
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo
echo % prepare repo a
mpm@selenic.com
[PATCH] Tests for clone command...
r550 mkdir a
cd a
hg init
echo a > a
hg add a
Martin Geisler
tests: removed redundant "-d '0 0'" from test scripts...
r8167 hg commit -m test
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo first line > b
hg add b
# create a non-inlined filelog
python -c 'for x in range(10000): print x' >> data1
for j in 0 1 2 3 4 5 6 7 8 9; do
cat data1 >> b
Martin Geisler
tests: removed redundant "-d '0 0'" from test scripts...
r8167 hg commit -m test
Adrian Buehlmann
increase code coverage of test-clone...
r6947 done
echo % "list files in store/data (should show a 'b.d')"
for i in .hg/store/data/*; do
echo $i
done
mpm@selenic.com
[PATCH] Tests for clone command...
r550
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo
echo % default operation
mpm@selenic.com
[PATCH] Tests for clone command...
r550 hg clone . ../b
cd ../b
cat a
hg verify
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo
Adrian Buehlmann
tests: use --debug on test-clone
r11295 echo % no update, with debug option
hg --debug clone -U . ../c
mpm@selenic.com
[PATCH] Tests for clone command...
r550 cd ../c
Peter van Dijk
changes by John Levon to standardize some erroroutput
r1926 cat a 2>/dev/null || echo "a not present"
mpm@selenic.com
[PATCH] Tests for clone command...
r550 hg verify
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo
echo % default destination
mpm@selenic.com
[PATCH] Tests for clone command...
r550 mkdir ../d
cd ../d
hg clone ../a
cd a
hg cat a
Alexis S. L. Carvalho
clone: remove "file://" before making the path absolute...
r5225
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo
Sune Foldager
handle file URIs correctly, according to RFC 2396 (issue1153)...
r9996 echo % "check that we drop the file: from the path before"
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo % "writing the .hgrc"
Alexis S. L. Carvalho
clone: remove "file://" before making the path absolute...
r5225 cd ../..
Sune Foldager
handle file URIs correctly, according to RFC 2396 (issue1153)...
r9996 hg clone file:a e
Alexis S. L. Carvalho
clone: remove "file://" before making the path absolute...
r5225 grep 'file:' e/.hg/hgrc
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo
echo % check that path aliases are expanded
Alexis S. L. Carvalho
clone: expand the path before saving it in .hg/hgrc...
r6088 hg clone -q -U --config 'paths.foobar=a#0' foobar f
hg -R f showconfig paths.default | sed -e 's,.*/,,'
Adrian Buehlmann
increase code coverage of test-clone...
r6947 echo
echo % use --pull
hg clone --pull a g
hg -R g verify
Steve Borho
allow clone into existing but empty directories
r7927 echo
echo % clone to '.'
mkdir h
cd h
hg clone ../a .
cd ..
Adrian Buehlmann
clone: add option -u/--updaterev
r9714 echo
echo
echo % "*** tests for option -u ***"
echo
echo
echo % "adding some more history to repo a"
cd a
echo % "tag ref1"
hg tag ref1
echo the quick brown fox >a
hg ci -m "hacked default"
echo % "updating back to ref1"
hg up ref1
echo
echo % "add branch 'stable' to repo a for later tests"
hg branch stable
echo some text >a
hg ci -m "starting branch stable"
echo % "tag ref2"
hg tag ref2
echo some more text >a
hg ci -m "another change for branch stable"
echo
echo % "updating back to ref2"
hg up ref2
echo
echo % "parents of repo a"
hg parents
echo
echo % "repo a has two heads"
hg heads
cd ..
echo
echo % "testing clone -U -u 1 a ua (must abort)"
hg clone -U -u 1 a ua
echo
echo % "testing clone -u . a ua"
hg clone -u . a ua
echo
echo % "repo ua has both heads"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua
echo
echo % "testing clone --pull -u . a ua"
hg clone --pull -u . a ua
echo
echo % "repo ua has both heads"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua
echo
echo % "testing clone -u stable a ua"
hg clone -u stable a ua
echo
echo % "repo ua has both heads"
hg -R ua heads
echo
echo % "branch stable is checked out"
hg -R ua parents
rm -r ua
echo
echo % "testing clone a ua"
hg clone a ua
echo
echo % "repo ua has both heads"
hg -R ua heads
echo
echo % "branch default is checked out"
hg -R ua parents
rm -r ua
echo
echo % "testing clone -u . a#stable ua"
hg clone -u . a#stable ua
echo
echo % "repo ua has only branch stable"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua
echo
echo % "testing clone -u . -r stable a ua"
hg clone -u . -r stable a ua
echo
echo % "repo ua has only branch stable"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua
echo
echo % "testing clone -r stable a ua"
hg clone -r stable a ua
echo
echo % "repo ua has only branch stable"
hg -R ua heads
echo
echo % "branch stable is checked out"
hg -R ua parents
rm -r ua
echo
echo % "testing clone -u . -r stable -r default a ua"
hg clone -u . -r stable -r default a ua
echo
echo % "repo ua has two heads"
hg -R ua heads
echo
echo % "same revision checked out in repo a and ua"
hg -R a parents --template "{node|short}\n"
hg -R ua parents --template "{node|short}\n"
rm -r ua
Nicolas Dumazet
hg.clone: fix branch value when passing a repo object (issue2267)...
r11544 cat <<EOF > simpleclone.py
from mercurial import ui, hg
myui = ui.ui()
repo = hg.repository(myui, 'a')
hg.clone(myui, repo, dest="ua")
EOF
python simpleclone.py
rm -r ua
Nicolas Dumazet
hg.clone: do not ignore branch argument when source is a repo object...
r11818 cat <<EOF > branchclone.py
from mercurial import ui, hg
myui = ui.ui()
repo = hg.repository(myui, 'a')
hg.clone(myui, repo, dest="ua", branch=["stable",])
EOF
python branchclone.py
rm -r ua
Alexis S. L. Carvalho
clone: remove "file://" before making the path absolute...
r5225 exit 0