test-convert-clonebranches
54 lines
| 1.0 KiB
| text/plain
|
TextLexer
/ tests / test-convert-clonebranches
Patrick Mezard
|
r5934 | #!/bin/sh | ||
echo "[extensions]" >> $HGRCPATH | ||||
Martin Geisler
|
r10119 | echo "convert = " >> $HGRCPATH | ||
Patrick Mezard
|
r5934 | echo "[convert]" >> $HGRCPATH | ||
echo "hg.tagsbranch=0" >> $HGRCPATH | ||||
hg init source | ||||
cd source | ||||
echo a > a | ||||
hg ci -qAm adda | ||||
# Add a merge with one parent in the same branch | ||||
echo a >> a | ||||
hg ci -qAm changea | ||||
hg up -qC 0 | ||||
hg branch branch0 | ||||
echo b > b | ||||
hg ci -qAm addb | ||||
hg up -qC | ||||
Dirkjan Ochtman
|
r6723 | hg merge default | ||
Patrick Mezard
|
r5934 | hg ci -qm mergeab | ||
hg tag -ql mergeab | ||||
cd .. | ||||
# Miss perl... sometimes | ||||
cat > filter.py <<EOF | ||||
import sys, re | ||||
r = re.compile(r'^(?:\d+|pulling from)') | ||||
sys.stdout.writelines([l for l in sys.stdin if r.search(l)]) | ||||
EOF | ||||
echo % convert | ||||
hg convert -v --config convert.hg.clonebranches=1 source dest | | ||||
python filter.py | ||||
# Add a merge with both parents and child in different branches | ||||
cd source | ||||
hg branch branch1 | ||||
echo a > file1 | ||||
hg ci -qAm c1 | ||||
hg up -qC mergeab | ||||
hg branch branch2 | ||||
echo a > file2 | ||||
hg ci -qAm c2 | ||||
hg merge branch1 | ||||
hg branch branch3 | ||||
hg ci -qAm c3 | ||||
cd .. | ||||
echo % incremental conversion | ||||
hg convert -v --config convert.hg.clonebranches=1 source dest | | ||||
python filter.py | ||||