tests/test-convert-cvs
author Thomas Arendsen Hein <thomas@intevation.de>
Tue, 22 Jan 2008 00:08:43 +0100
changeset 5919 badf5711bd86
parent 5381 6874368120dc
child 5921 549a7ebe1607
permissions -rwxr-xr-x
Test for converting a CVS branch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5307
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
"$TESTDIR/hghave" cvs cvsps || exit 80
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
echo "[extensions]" >> $HGRCPATH
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
echo "convert = " >> $HGRCPATH
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
echo % create cvs repository
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
mkdir cvsrepo
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
cd cvsrepo
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
export CVSROOT=`pwd`
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
cd ..
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
cvs -q -d "$CVSROOT" init
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    15
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
echo % create source directory
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
mkdir src-temp
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
cd src-temp
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
echo a > a
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
mkdir b
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
cd b
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
echo c > c
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
cd ..
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
echo % import source directory
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
cvs -q import -m import src INITIAL start
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
cd ..
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
echo % checkout source directory
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
cvs -q checkout src
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
5381
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    32
echo % commit a new revision changing b/c
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    33
cd src
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    34
echo c >> b/c
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    35
cvs -q commit -mci0 . | grep '<--' |\
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    36
    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    37
cd ..
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    38
5307
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
echo % convert fresh repo
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
cat src-hg/a
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
cat src-hg/b/c
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
5381
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    44
echo % convert fresh repo with --filemap
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    45
echo include b/c > filemap
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    46
hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    47
cat src-hg/b/c
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    48
hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    49
5307
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    50
echo % commit new file revisions
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    51
cd src
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    52
echo a >> a
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
echo c >> b/c
5364
645a40777fd4 test-convert-cvs: handle older cvs client
Christian Ebert <blacktrash@gmx.net>
parents: 5307
diff changeset
    54
cvs -q commit -mci1 . | grep '<--' |\
645a40777fd4 test-convert-cvs: handle older cvs client
Christian Ebert <blacktrash@gmx.net>
parents: 5307
diff changeset
    55
    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
5307
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    56
cd ..
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    57
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    58
echo % convert again
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    59
hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    60
cat src-hg/a
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    61
cat src-hg/b/c
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    62
5381
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    63
echo % convert again with --filemap
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    64
hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    65
cat src-hg/b/c
6874368120dc convert_cvs: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5364
diff changeset
    66
hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
5307
5b0b0834419c convert: test cvs repository conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    67
5919
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    68
echo % commit branch
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    69
cd src
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    70
cvs -q update -r1.1 b/c
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    71
cvs -q tag -b branch
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    72
cvs -q update -r branch
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    73
echo d >> b/c
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    74
cvs -q commit -mci2 . | grep '<--' |\
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    75
    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    76
cd ..
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    77
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    78
echo % convert again
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    79
hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    80
cat src-hg/a
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    81
cat src-hg/b/c
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    82
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    83
echo % convert again with --filemap
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    84
hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    85
cat src-hg/b/c
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    86
hg -R src-filemap log --template '#rev# #desc# files: #files#\n'
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    87
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    88
echo "graphlog = " >> $HGRCPATH
badf5711bd86 Test for converting a CVS branch
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5381
diff changeset
    89
hg -R src-hg glog --template '#rev# (#branches#) #desc# files: #files#\n'