Mercurial > hg
comparison tests/test-convert-cvs-builtincvsps @ 6690:127e8c3466d1
convert: cvs.py - Allow user to use built-in CVS changeset code.
tests: add two testcases for CVS conversion with builtin CVS
including a testcase for issue 1148.
author | Frank Kingswood <frank@kingswood-consulting.co.uk> |
---|---|
date | Sun, 15 Jun 2008 16:05:46 +0100 |
parents | |
children | 2011bb8ada9a |
comparison
equal
deleted
inserted
replaced
6689:d2ac53fe216e | 6690:127e8c3466d1 |
---|---|
1 #!/bin/sh | |
2 | |
3 "$TESTDIR/hghave" cvs || exit 80 | |
4 | |
5 cvscall() | |
6 { | |
7 cvs -f "$@" | |
8 } | |
9 | |
10 echo "[extensions]" >> $HGRCPATH | |
11 echo "convert = " >> $HGRCPATH | |
12 echo "graphlog = " >> $HGRCPATH | |
13 echo "[convert]" >> $HGRCPATH | |
14 echo "cvsps=builtin" >> $HGRCPATH | |
15 | |
16 echo % create cvs repository | |
17 mkdir cvsrepo | |
18 cd cvsrepo | |
19 export CVSROOT=`pwd` | |
20 export CVS_OPTIONS=-f | |
21 cd .. | |
22 | |
23 cvscall -q -d "$CVSROOT" init | |
24 | |
25 echo % create source directory | |
26 mkdir src-temp | |
27 cd src-temp | |
28 echo a > a | |
29 mkdir b | |
30 cd b | |
31 echo c > c | |
32 cd .. | |
33 | |
34 echo % import source directory | |
35 cvscall -q import -m import src INITIAL start | |
36 cd .. | |
37 | |
38 echo % checkout source directory | |
39 cvscall -q checkout src | |
40 | |
41 echo % commit a new revision changing b/c | |
42 cd src | |
43 sleep 1 | |
44 echo c >> b/c | |
45 cvscall -q commit -mci0 . | grep '<--' |\ | |
46 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' | |
47 cd .. | |
48 | |
49 echo % convert fresh repo | |
50 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' | |
51 cat src-hg/a | |
52 cat src-hg/b/c | |
53 | |
54 echo % convert fresh repo with --filemap | |
55 echo include b/c > filemap | |
56 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' | |
57 cat src-hg/b/c | |
58 hg -R src-filemap log --template '#rev# #desc# files: #files#\n' | |
59 | |
60 echo % commit new file revisions | |
61 cd src | |
62 echo a >> a | |
63 echo c >> b/c | |
64 cvscall -q commit -mci1 . | grep '<--' |\ | |
65 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' | |
66 cd .. | |
67 | |
68 echo % convert again | |
69 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' | |
70 cat src-hg/a | |
71 cat src-hg/b/c | |
72 | |
73 echo % convert again with --filemap | |
74 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' | |
75 cat src-hg/b/c | |
76 hg -R src-filemap log --template '#rev# #desc# files: #files#\n' | |
77 | |
78 echo % commit branch | |
79 cd src | |
80 cvs -q update -r1.1 b/c | |
81 cvs -q tag -b branch | |
82 cvs -q update -r branch | |
83 echo d >> b/c | |
84 cvs -q commit -mci2 . | grep '<--' |\ | |
85 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' | |
86 cd .. | |
87 | |
88 echo % convert again | |
89 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' | |
90 cat src-hg/a | |
91 cat src-hg/b/c | |
92 | |
93 echo % convert again with --filemap | |
94 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' | |
95 cat src-hg/b/c | |
96 hg -R src-filemap log --template '#rev# #desc# files: #files#\n' | |
97 | |
98 echo "graphlog = " >> $HGRCPATH | |
99 hg -R src-hg glog --template '#rev# (#branches#) #desc# files: #files#\n' |