mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
ccca7abe8e
The bzr converter maintains a child -> parents mapping and drop entries whenever a child is read. It does not work with filemaps, getchangedfiles() may be called more than once when filtered files belong to merge revisions. getchanges() still works that way but it is not clear whether a similar issue can arise when interacting with merges.
98 lines
1.9 KiB
Bash
Executable File
98 lines
1.9 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
. "$TESTDIR/bzr-definitions"
|
|
|
|
echo % create and rename on the same file in the same step
|
|
mkdir test-createandrename
|
|
cd test-createandrename
|
|
bzr init -q source
|
|
cd source
|
|
echo a > a
|
|
echo c > c
|
|
echo e > e
|
|
bzr add -q a c e
|
|
bzr commit -q -m 'Initial add: a, c, e'
|
|
bzr mv a b
|
|
bzr mv c d
|
|
bzr mv e f
|
|
echo a2 >> a
|
|
mkdir e
|
|
bzr add -q a e
|
|
bzr commit -q -m 'rename a into b, create a, rename c into d'
|
|
cd ..
|
|
hg convert source source-hg
|
|
glog -R source-hg
|
|
echo "% manifest"
|
|
hg manifest -R source-hg -r tip
|
|
echo "% test --rev option"
|
|
hg convert -r 1 source source-1-hg
|
|
glog -R source-1-hg
|
|
echo "% test with filemap"
|
|
cat > filemap <<EOF
|
|
exclude a
|
|
EOF
|
|
hg convert --filemap filemap source source-filemap-hg
|
|
hg -R source-filemap-hg manifest -r tip
|
|
cd ..
|
|
|
|
echo % merge
|
|
mkdir test-merge
|
|
cd test-merge
|
|
|
|
cat > helper.py <<EOF
|
|
import sys
|
|
from bzrlib import workingtree
|
|
wt = workingtree.WorkingTree.open('.')
|
|
|
|
message, stamp = sys.argv[1:]
|
|
wt.commit(message, timestamp=int(stamp))
|
|
EOF
|
|
|
|
bzr init -q source
|
|
cd source
|
|
echo content > a
|
|
echo content2 > b
|
|
bzr add -q a b
|
|
bzr commit -q -m 'Initial add'
|
|
cd ..
|
|
bzr branch -q source source-improve
|
|
cd source
|
|
echo more >> a
|
|
python ../helper.py 'Editing a' 100
|
|
cd ../source-improve
|
|
echo content3 >> b
|
|
python ../helper.py 'Editing b' 200
|
|
cd ../source
|
|
bzr merge -q ../source-improve
|
|
bzr commit -q -m 'Merged improve branch'
|
|
cd ..
|
|
hg convert --datesort source source-hg
|
|
glog -R source-hg
|
|
cd ..
|
|
|
|
echo % symlinks and executable files
|
|
mkdir test-symlinks
|
|
cd test-symlinks
|
|
bzr init -q source
|
|
cd source
|
|
touch program
|
|
chmod +x program
|
|
ln -s program altname
|
|
mkdir d
|
|
echo a > d/a
|
|
ln -s a syma
|
|
bzr add -q altname program syma d/a
|
|
bzr commit -q -m 'Initial setup'
|
|
touch newprog
|
|
chmod +x newprog
|
|
rm altname
|
|
ln -s newprog altname
|
|
chmod -x program
|
|
bzr add -q newprog
|
|
bzr commit -q -m 'Symlink changed, x bits changed'
|
|
cd ..
|
|
hg convert source source-hg
|
|
manifest source-hg 0
|
|
manifest source-hg tip
|
|
cd ..
|