comparison tests/test-convert-svn-sink @ 5513:f0c58fd4b798

convert: add support for Subversion as a sink
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 07 Nov 2007 18:26:59 -0800
parents
children dc8fa3482a9a
comparison
equal deleted inserted replaced
5512:8cd26ccc68f8 5513:f0c58fd4b798
1 #!/bin/sh
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
5 echo "[extensions]" >> $HGRCPATH
6 echo "convert = " >> $HGRCPATH
7
8 hg init a
9
10 echo a > a/a
11 echo % add
12 hg --cwd a ci -d '0 0' -A -m 'add a file'
13
14 echo a >> a/a
15 echo % modify
16 hg --cwd a ci -d '1 0' -m 'modify a file'
17 hg --cwd a tip -q
18
19 hg convert -d svn a
20 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=2 | sed 's,<date>.*,<date/>,')
21 ls a a-hg-wc
22 cmp a/a a-hg-wc/a && echo same || echo different
23
24 hg --cwd a mv a b
25 echo % rename
26 hg --cwd a ci -d '2 0' -m 'rename a file'
27 hg --cwd a tip -q
28
29 hg convert -d svn a
30 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
31 ls a a-hg-wc
32
33 hg --cwd a cp b c
34 echo % copy
35 hg --cwd a ci -d '3 0' -m 'copy a file'
36 hg --cwd a tip -q
37
38 hg convert -d svn a
39 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
40 ls a a-hg-wc
41
42 hg --cwd a rm b
43 echo % remove
44 hg --cwd a ci -d '4 0' -m 'remove a file'
45 hg --cwd a tip -q
46
47 hg convert -d svn a
48 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
49 ls a a-hg-wc
50
51 chmod +x a/c
52 echo % executable
53 hg --cwd a ci -d '5 0' -m 'make a file executable'
54 hg --cwd a tip -q
55
56 hg convert -d svn a
57 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
58 test -x a-hg-wc/c && echo executable || echo not executable
59
60 echo % branchy history
61
62 hg init b
63 echo base > b/b
64 hg --cwd b ci -d '0 0' -Ambase
65
66 echo left-1 >> b/b
67 echo left-1 > b/left-1
68 hg --cwd b ci -d '1 0' -Amleft-1
69
70 echo left-2 >> b/b
71 echo left-2 > b/left-2
72 hg --cwd b ci -d '2 0' -Amleft-2
73
74 hg --cwd b up 0
75
76 echo right-1 >> b/b
77 echo right-1 > b/right-1
78 hg --cwd b ci -d '3 0' -Amright-1
79
80 echo right-2 >> b/b
81 echo right-2 > b/right-2
82 hg --cwd b ci -d '4 0' -Amright-2
83
84 hg --cwd b up -C 2
85 hg --cwd b merge
86 hg --cwd b revert -r 2 b
87 hg --cwd b ci -d '5 0' -m 'merge'
88
89 hg convert -d svn b
90 echo % expect 4 changes
91 (cd b-hg-wc; svn up; svn st -v; svn log --xml -v | sed 's,<date>.*,<date/>,')