monotone

monotone Mtn Source Tree

Root/tests/t_cvsimport.at

1# -*- Autoconf -*-
2
3AT_SETUP([importing CVS files])
4
5MONOTONE_SETUP
6
7AT_DATA(importme.0, [version 0 of test file
8])
9
10AT_DATA(importme.1, [version 1 of test file
11])
12
13AT_DATA(importme.2, [version 2 of test file
14])
15
16AT_DATA(importme.3, [version 3 of test file
17])
18
19TSHA0=`SHA1(importme.0)`
20TSHA1=`SHA1(importme.1)`
21TSHA2=`SHA1(importme.2)`
22TSHA3=`SHA1(importme.3)`
23
24# build the cvs repository
25
26CVSROOT=`pwd`/cvs-repository
27AT_CHECK(cvs -q -d $CVSROOT init)
28AT_CHECK(test -e $CVSROOT)
29AT_CHECK(test -e $CVSROOT/CVSROOT)
30AT_CHECK(test -e $CVSROOT/CVSROOT/history)
31
32# check out the working copy and make some commits
33
34AT_CHECK(cvs -d $CVSROOT co ., [], [ignore], [ignore])
35AT_CHECK(mkdir testdir)
36AT_CHECK(cp importme.0 testdir/importme)
37AT_CHECK(cvs -d $CVSROOT add testdir, [], [ignore], [ignore])
38AT_CHECK(cvs -d $CVSROOT add testdir/importme, [], [ignore], [ignore])
39AT_CHECK(cvs -d $CVSROOT commit -m 'commit 0' testdir/importme, [], [ignore], [ignore])
40AT_CHECK(cp importme.1 testdir/importme)
41AT_CHECK(cvs -d $CVSROOT commit -m 'commit 1' testdir/importme, [], [ignore], [ignore])
42AT_CHECK(cp importme.2 testdir/importme)
43AT_CHECK(cvs -d $CVSROOT commit -m 'commit 2' testdir/importme, [], [ignore], [ignore])
44AT_CHECK(cp importme.3 testdir/importme)
45AT_CHECK(cvs -d $CVSROOT commit -m 'commit 3' testdir/importme, [], [ignore], [ignore])
46
47# import into monotone and get a packet stream
48
49AT_CHECK(cp test.db test2.db)
50AT_CHECK(MONOTONE --branch=testbranch cvs_import $CVSROOT/testdir, [], [ignore], [ignore])
51AT_CHECK(MONOTONE cat file $TSHA0, [], [ignore])
52AT_CHECK(MONOTONE cat file $TSHA1, [], [ignore])
53AT_CHECK(MONOTONE cat file $TSHA2, [], [ignore])
54AT_CHECK(MONOTONE cat file $TSHA3, [], [ignore])
55AT_CHECK(MONOTONE --branch=testbranch queue addtree http://www.nothing.com/depot.cgi/test, [], [ignore], [ignore])
56AT_CHECK(MONOTONE debug 'select content from posting_queue', [], [stdout], [ignore])
57AT_CHECK(cp stdout import-packets)
58
59# load results into secondary db and check
60
61AT_CHECK(MONOTONE --db=test2.db read <import-packets, [], [ignore], [ignore])
62AT_CHECK(MONOTONE --db=test2.db cat file $TSHA0, [], [stdout], [ignore])
63AT_CHECK(cmp importme.0 stdout)
64AT_CHECK(MONOTONE --db=test2.db cat file $TSHA1, [], [stdout], [ignore])
65AT_CHECK(cmp importme.1 stdout)
66AT_CHECK(MONOTONE --db=test2.db cat file $TSHA2, [], [stdout], [ignore])
67AT_CHECK(cmp importme.2 stdout)
68AT_CHECK(MONOTONE --db=test2.db cat file $TSHA3, [], [stdout], [ignore])
69AT_CHECK(cmp importme.3 stdout)
70
71AT_CLEANUP

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status