##// END OF EJS Templates
tests: unify test-convert-darcs
Matt Mackall -
r12524:8773cac3 default
parent child Browse files
Show More
@@ -1,84 +1,131
1 #!/bin/sh
2
3 "$TESTDIR/hghave" darcs || exit 80
4 1
5 echo "[extensions]" >> $HGRCPATH
6 echo "convert=" >> $HGRCPATH
7 echo 'graphlog =' >> $HGRCPATH
2 $ "$TESTDIR/hghave" darcs || exit 80
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "convert=" >> $HGRCPATH
5 $ echo 'graphlog =' >> $HGRCPATH
6 $ DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
7 $ HOME=`pwd`/do_not_use_HOME_darcs; export HOME
8
9 skip if we can't import elementtree
8 10
9 DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
10 HOME=`pwd`/do_not_use_HOME_darcs; export HOME
11 $ mkdir dummy
12 $ mkdir dummy/_darcs
13 $ if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
14 > echo 'skipped: missing feature: elementtree module'
15 > exit 80
16 > fi
11 17
12 # skip if we can't import elementtree
13 mkdir dummy
14 mkdir dummy/_darcs
15 if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
16 echo 'skipped: missing feature: elementtree module'
17 exit 80
18 fi
18 try converting darcs1 repository
19
20 $ hg clone -q "$TESTDIR/darcs1.hg" darcs
21 $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
22 darcs-1.0 repository format is unsupported, please upgrade
23
24 initialize darcs repo
19 25
20 echo '% try converting darcs1 repository'
21 hg clone -q "$TESTDIR/darcs1.hg" darcs
22 hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
26 $ mkdir darcs-repo
27 $ cd darcs-repo
28 $ darcs init
29 $ echo a > a
30 $ darcs record -a -l -m p0
31 Finished recording patch 'p0'
32 $ cd ..
33
34 branch and update
23 35
24 echo % initialize darcs repo
25 mkdir darcs-repo
26 cd darcs-repo
27 darcs init
28 echo a > a
29 darcs record -a -l -m p0
30 cd ..
36 $ darcs get darcs-repo darcs-clone >/dev/null
37 $ cd darcs-clone
38 $ echo c >> a
39 $ echo c > c
40 $ darcs record -a -l -m p1.1
41 Finished recording patch 'p1.1'
42 $ cd ..
31 43
32 echo % branch and update
33 darcs get darcs-repo darcs-clone >/dev/null
34 cd darcs-clone
35 echo c >> a
36 echo c > c
37 darcs record -a -l -m p1.1
38 cd ..
44 update source
45
46 $ cd darcs-repo
47 $ echo b >> a
48 $ echo b > b
49 $ darcs record -a -l -m p1.2
50 Finished recording patch 'p1.2'
51
52 merge branch
39 53
40 echo % update source
41 cd darcs-repo
42 echo b >> a
43 echo b > b
44 darcs record -a -l -m p1.2
54 $ darcs pull -a ../darcs-clone
55 Backing up ./a(-darcs-backup0)
56 We have conflicts in the following files:
57 ./a
58 Finished pulling and applying.
59 $ sleep 1
60 $ echo e > a
61 $ echo f > f
62 $ mkdir dir
63 $ echo d > dir/d
64 $ echo d > dir/d2
65 $ darcs record -a -l -m p2
66 Finished recording patch 'p2'
67
68 test file and directory move
45 69
46 echo % merge branch
47 darcs pull -a ../darcs-clone
48 sleep 1
49 echo e > a
50 echo f > f
51 mkdir dir
52 echo d > dir/d
53 echo d > dir/d2
54 darcs record -a -l -m p2
70 $ darcs mv f ff
71
72 Test remove + move
73
74 $ darcs remove dir/d2
75 $ rm dir/d2
76 $ darcs mv dir dir2
77 $ darcs record -a -l -m p3
78 Finished recording patch 'p3'
79
80 test utf-8 commit message and author
81
82 $ echo g > g
83
84 darcs is encoding agnostic, so it takes whatever bytes it's given
55 85
56 echo % test file and directory move
57 darcs mv f ff
58 # Test remove + move
59 darcs remove dir/d2
60 rm dir/d2
61 darcs mv dir dir2
62 darcs record -a -l -m p3
63
64 echo % test utf-8 commit message and author
65 echo g > g
66 # darcs is encoding agnostic, so it takes whatever bytes it's given
67 darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
86 $ darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
87 Finished recording patch 'p4: desc ñ'
88 $ glog()
89 > {
90 > HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
91 > }
92 $ cd ..
93 $ hg convert darcs-repo darcs-repo-hg
94 initializing destination darcs-repo-hg repository
95 scanning source...
96 sorting...
97 converting...
98 5 p0
99 4 p1.2
100 3 p1.1
101 2 p2
102 1 p3
103 0 p4: desc ?
68 104
69 glog()
70 {
71 HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
72 }
105 The converter does not currently handle patch conflicts very well.
106 When they occur, it reverts *all* changes and moves forward,
107 letting the conflict resolving patch fix collisions.
108 Unfortunately, non-conflicting changes, like the addition of the
109 "c" file in p1.1 patch are reverted too.
110 Just to say that manifest not listing "c" here is a bug.
73 111
74 cd ..
75 hg convert darcs-repo darcs-repo-hg
76 # The converter does not currently handle patch conflicts very well.
77 # When they occur, it reverts *all* changes and moves forward,
78 # letting the conflict resolving patch fix collisions.
79 # Unfortunately, non-conflicting changes, like the addition of the
80 # "c" file in p1.1 patch are reverted too.
81 # Just to say that manifest not listing "c" here is a bug.
82 glog -R darcs-repo-hg
83 hg up -q -R darcs-repo-hg
84 hg -R darcs-repo-hg manifest --debug
112 $ glog -R darcs-repo-hg
113 o 5 "p4: desc ñ" (author ñ) files: g
114 |
115 o 4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
116 |
117 o 3 "p2" (test@example.org) files: a dir/d dir/d2 f
118 |
119 o 2 "p1.1" (test@example.org) files:
120 |
121 o 1 "p1.2" (test@example.org) files: a b
122 |
123 o 0 "p0" (test@example.org) files: a
124
125 $ hg up -q -R darcs-repo-hg
126 $ hg -R darcs-repo-hg manifest --debug
127 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a
128 1e88685f5ddec574a34c70af492f95b6debc8741 644 b
129 37406831adc447ec2385014019599dfec953c806 644 dir2/d
130 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff
131 0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644 g
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now