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