tests/test-convert-cvs-branch
author Martin Geisler <mg@lazybytes.net>
Tue, 23 Jun 2009 15:51:27 +0200
changeset 8900 589a3d022079
parent 8756 6019e6517f95
child 8936 1de6e7e1bb9f
permissions -rwxr-xr-x
hgrc.5: remove reference to DEFAULT section
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6690
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
     1
#!/bin/sh
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
     2
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
     3
# This is http://www.selenic.com/mercurial/bts/issue1148
8756
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
     4
#     and http://www.selenic.com/mercurial/bts/issue1447
6690
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
     5
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
     6
"$TESTDIR/hghave" cvs || exit 80
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
     7
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
     8
cvscall()
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
     9
{
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    10
    cvs -f "$@"
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    11
}
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    12
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    13
echo "[extensions]" >> $HGRCPATH
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    14
echo "convert = " >> $HGRCPATH
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    15
echo "graphlog = " >> $HGRCPATH
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    16
echo "[convert]" >> $HGRCPATH
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    17
echo "cvsps=builtin" >> $HGRCPATH
8169
6584953be356 convert/cvs: add an option to disable remote log caching
Patrick Mezard <pmezard@gmail.com>
parents: 7812
diff changeset
    18
echo "cvsps.cache=0" >> $HGRCPATH
6690
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    19
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    20
echo % create cvs repository
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    21
mkdir cvsrepo
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    22
cd cvsrepo
8350
1f0f01bc86a5 tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents: 8169
diff changeset
    23
CVSROOT=`pwd`
1f0f01bc86a5 tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents: 8169
diff changeset
    24
export CVSROOT
1f0f01bc86a5 tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents: 8169
diff changeset
    25
CVS_OPTIONS=-f
1f0f01bc86a5 tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents: 8169
diff changeset
    26
export CVS_OPTIONS
6690
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    27
cd ..
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    28
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    29
cvscall -q -d "$CVSROOT" init
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    30
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    31
echo % Create a new project
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    32
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    33
mkdir src
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    34
cd src
7465
8f0305874701 tests: allow cvs import to reorder its filename list
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6690
diff changeset
    35
echo "1" > a
8f0305874701 tests: allow cvs import to reorder its filename list
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6690
diff changeset
    36
echo "1" > b
8f0305874701 tests: allow cvs import to reorder its filename list
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6690
diff changeset
    37
cvscall import -m "init" src v0 r0 | sort
6690
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    38
cd ..
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    39
cvscall co src
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    40
cd src
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    41
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    42
echo % Branch the project
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    43
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    44
cvscall tag -b BRANCH
7812
18048153fd4e test-convert-cvs*: mute output from "cvs up"
Mads Kiilerich <mads@kiilerich.com>
parents: 7465
diff changeset
    45
cvscall up -r BRANCH > /dev/null
6690
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    46
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    47
echo % Modify file a, then b, then a 
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    48
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    49
echo "2" > a
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    50
cvscall ci -m "mod a" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    51
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    52
echo "2" > b
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    53
cvscall ci -m "mod b" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    54
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    55
echo "3" > a
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    56
cvscall ci -m "mod a again" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    57
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    58
echo % Convert
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    59
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    60
cd ..
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    61
hg convert src | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    62
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    63
echo % Check the result
127e8c3466d1 convert: cvs.py - Allow user to use built-in CVS changeset code.
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents:
diff changeset
    64
8523
5b7da468531b tests: replace #...# syntax with {...}
Martin Geisler <mg@lazybytes.net>
parents: 8350
diff changeset
    65
hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n'
8756
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    66
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    67
echo ""
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    68
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    69
echo % issue 1447
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    70
cvscall()
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    71
{
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    72
    echo cvs -f "$@"
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    73
    cvs -f "$@"
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    74
    sleep 1
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    75
}
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    76
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    77
cvsci()
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    78
{
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    79
    echo cvs -f ci "$@"
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    80
    cvs -f ci "$@" >/dev/null 2>&1
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    81
    sleep 1
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    82
}
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    83
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    84
cvscall -Q -d `pwd`/cvsmaster2 init >/dev/null 2>&1
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    85
cd cvsmaster2
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    86
export CVSROOT=`pwd`
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    87
mkdir foo
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    88
cd ..
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    89
cvscall -Q co -d cvswork2 foo
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    90
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    91
cd cvswork2
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    92
echo foo > a.txt
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    93
echo bar > b.txt
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    94
cvscall -Q add a.txt b.txt
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    95
cvsci -m "Initial commit"
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    96
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    97
echo foo > b.txt
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    98
cvsci -m "Fix b on HEAD"
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
    99
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   100
echo bar > a.txt
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   101
cvsci -m "Small fix in a on HEAD"
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   102
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   103
cvscall -Q tag -b BRANCH
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   104
cvscall -Q up -P -rBRANCH
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   105
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   106
echo baz > b.txt
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   107
cvsci -m "Change on BRANCH in b"
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   108
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   109
hg debugcvsps -x --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   110
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   111
cd ..
6019e6517f95 convert: better support for CVS branchpoints (issue1447)
Henrik Stuart <hg@hstuart.dk>
parents: 8523
diff changeset
   112