tests/test-convert-baz
author Dirkjan Ochtman <dirkjan@ochtman.nl>
Fri, 13 Feb 2009 11:32:33 +0100
changeset 7757 af6a63438a8a
parent 7567 0946294d1f32
child 8267 faa318261ee8
permissions -rwxr-xr-x
identify: have consistent output for local repositories Also, add some extensive testing for it (hardly any in the suite so far).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     1
#!/bin/sh
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     3
"$TESTDIR/hghave" baz || exit 80
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     4
6101
abb1c451a88e Define tla username locally in baz and tla tests
Patrick Mezard <pmezard@gmail.com>
parents: 6084
diff changeset
     5
mkdir do_not_use_HOME_baz
abb1c451a88e Define tla username locally in baz and tla tests
Patrick Mezard <pmezard@gmail.com>
parents: 6084
diff changeset
     6
cd do_not_use_HOME_baz
abb1c451a88e Define tla username locally in baz and tla tests
Patrick Mezard <pmezard@gmail.com>
parents: 6084
diff changeset
     7
HOME=`pwd`; export HOME
abb1c451a88e Define tla username locally in baz and tla tests
Patrick Mezard <pmezard@gmail.com>
parents: 6084
diff changeset
     8
cd ..
6102
4e351c03a31a test-convert-baz: set username with baz, not tla
Patrick Mezard <pmezard@gmail.com>
parents: 6101
diff changeset
     9
baz my-id "mercurial <mercurial@selenic.com>"
6084
a672df805855 Document and fix tla/baz conversion tests
Patrick Mezard <pmezard@gmail.com>
parents: 6078
diff changeset
    10
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    11
echo "[extensions]" >> $HGRCPATH
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    12
echo "convert=" >> $HGRCPATH
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    13
echo 'hgext.graphlog =' >> $HGRCPATH
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    14
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    15
echo % create baz archive
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    16
baz make-archive baz@mercurial--convert hg-test-convert-baz
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    17
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    18
echo % initialize baz repo
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    19
mkdir baz-repo
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    20
cd baz-repo/
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    21
baz init-tree baz@mercurial--convert/baz--test--0
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    22
baz import
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    23
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    24
echo % create initial files
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    25
echo 'this is a file' > a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    26
baz add a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    27
mkdir src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    28
baz add src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    29
cd src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    30
dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    31
baz add b
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    32
baz commit -s "added a file, src and src/b (binary)"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    33
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    34
echo % create link file and modify a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    35
ln -s ../a a-link
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    36
baz add a-link
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    37
echo 'this a modification to a' >> ../a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    38
baz commit -s "added link to a and modify a"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    39
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    40
echo % create second link and modify b
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    41
ln -s ../a a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    42
baz add a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    43
dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    44
baz commit -s "added second link and modify b"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    45
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    46
echo % b file to link and a-link-2 to regular file
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    47
rm -f a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    48
echo 'this is now a regular file' > a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    49
ln -sf ../a b
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    50
baz commit -s "file to link and link to file test"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    51
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    52
echo % move a-link-2 file and src directory
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    53
cd ..
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    54
baz mv src/a-link-2 c
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    55
baz mv src test
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    56
baz commit -s "move and rename a-link-2 file and src directory"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    57
7567
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    58
echo % move and add the moved file again
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    59
echo e > e
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    60
baz add e
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    61
baz commit -s "add e"
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    62
baz mv e f
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    63
echo ee > e
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    64
baz add e
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    65
baz commit -s "move e and recreate it again"
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    66
cd ..
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    67
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    68
echo % converting baz repo to Mercurial
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    69
hg convert baz-repo baz-repo-hg
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    70
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    71
baz register-archive -d baz@mercurial--convert
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    72
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    73
glog()
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    74
{
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    75
    hg glog --template '#rev# "#desc|firstline#" files: #files#\n' "$@"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    76
}
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    77
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    78
echo % show graph log
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    79
glog -R baz-repo-hg
6799
12d1e1e79faf Fix tests failures introduced by 7239e06e58e9
Patrick Mezard <pmezard@gmail.com>
parents: 6102
diff changeset
    80
hg up -q -R baz-repo-hg
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    81
hg -R baz-repo-hg manifest --debug
7567
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
    82
hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies