tests/test-convert-baz
author Aleix Conchillo Flaque <aleix@member.fsf.org>
Tue, 12 Feb 2008 10:38:34 +0100
changeset 6078 ebc23d34102f
child 6084 a672df805855
permissions -rw-r--r--
convert: added gnu arch (baz) tests
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
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     5
echo "[extensions]" >> $HGRCPATH
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     6
echo "convert=" >> $HGRCPATH
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     7
echo 'hgext.graphlog =' >> $HGRCPATH
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     8
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
     9
echo % create baz archive
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    10
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
    11
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    12
echo % initialize baz repo
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    13
mkdir baz-repo
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    14
cd baz-repo/
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    15
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
    16
baz import
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 % create initial files
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    19
echo 'this is a file' > a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    20
baz add a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    21
mkdir src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    22
baz add src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    23
cd src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    24
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
    25
baz add b
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    26
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
    27
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    28
echo % create link file and modify a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    29
ln -s ../a a-link
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    30
baz add a-link
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    31
echo 'this a modification to a' >> ../a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    32
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
    33
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    34
echo % create second link and modify b
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    35
ln -s ../a a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    36
baz add a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    37
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
    38
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
    39
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    40
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
    41
rm -f a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    42
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
    43
ln -sf ../a b
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    44
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
    45
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    46
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
    47
cd ..
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    48
baz mv src/a-link-2 c
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    49
baz mv src test
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    50
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
    51
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    52
cd ..
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    53
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    54
echo % converting baz repo to Mercurial
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    55
hg convert baz-repo baz-repo-hg
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    56
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    57
baz register-archive -d baz@mercurial--convert
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    58
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    59
glog()
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    60
{
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    61
    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
    62
}
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    63
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    64
echo % show graph log
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    65
glog -R baz-repo-hg
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
    66
hg -R baz-repo-hg manifest --debug