| 1 |
#require darcs |
| 2 |
|
| 3 |
$ echo "[extensions]" >> $HGRCPATH |
| 4 |
$ echo "convert=" >> $HGRCPATH |
| 5 |
$ DARCS_EMAIL='[email protected]'; export DARCS_EMAIL |
| 6 |
|
| 7 |
initialize darcs repo |
| 8 |
|
| 9 |
$ mkdir darcs-repo |
| 10 |
$ cd darcs-repo |
| 11 |
$ darcs init -q |
| 12 |
$ echo a > a |
| 13 |
$ darcs record -a -l -m p0 |
| 14 |
Finished recording patch 'p0' |
| 15 |
$ cd .. |
| 16 |
|
| 17 |
branch and update |
| 18 |
|
| 19 |
$ darcs get -q darcs-repo darcs-clone >/dev/null |
| 20 |
$ cd darcs-clone |
| 21 |
$ echo c >> a |
| 22 |
$ echo c > c |
| 23 |
$ darcs record -a -l -m p1.1 |
| 24 |
Finished recording patch 'p1.1' |
| 25 |
$ cd .. |
| 26 |
|
| 27 |
skip if we can't import elementtree |
| 28 |
|
| 29 |
$ if hg convert darcs-repo darcs-dummy 2>&1 | grep ElementTree > /dev/null; then |
| 30 |
> echo 'skipped: missing feature: elementtree module' |
| 31 |
> exit 80 |
| 32 |
> fi |
| 33 |
|
| 34 |
update source |
| 35 |
|
| 36 |
$ cd darcs-repo |
| 37 |
$ echo b >> a |
| 38 |
$ echo b > b |
| 39 |
$ darcs record -a -l -m p1.2 |
| 40 |
Finished recording patch 'p1.2' |
| 41 |
|
| 42 |
$ darcs pull -q -a --no-set-default ../darcs-clone |
| 43 |
Backing up ./a(*) (glob) |
| 44 |
We have conflicts in the following files: |
| 45 |
./a |
| 46 |
(?) |
| 47 |
$ sleep 1 |
| 48 |
$ echo e > a |
| 49 |
$ echo f > f |
| 50 |
$ mkdir dir |
| 51 |
$ echo d > dir/d |
| 52 |
$ echo d > dir/d2 |
| 53 |
$ darcs record -a -l -m p2 |
| 54 |
Finished recording patch 'p2' |
| 55 |
|
| 56 |
test file and directory move |
| 57 |
|
| 58 |
$ darcs mv -q f ff |
| 59 |
|
| 60 |
Test remove + move |
| 61 |
|
| 62 |
$ darcs remove -q dir/d2 |
| 63 |
$ rm dir/d2 |
| 64 |
$ darcs mv -q dir dir2 |
| 65 |
$ darcs record -a -l -m p3 |
| 66 |
Finished recording patch 'p3' |
| 67 |
|
| 68 |
The converter does not currently handle patch conflicts very well. |
| 69 |
When they occur, it reverts *all* changes and moves forward, |
| 70 |
letting the conflict resolving patch fix collisions. |
| 71 |
Unfortunately, non-conflicting changes, like the addition of the |
| 72 |
"c" file in p1.1 patch are reverted too. |
| 73 |
Just to say that manifest not listing "c" here is a bug. |
| 74 |
|
| 75 |
$ cd .. |
| 76 |
$ hg convert darcs-repo darcs-repo-hg |
| 77 |
initializing destination darcs-repo-hg repository |
| 78 |
scanning source... |
| 79 |
sorting... |
| 80 |
converting... |
| 81 |
4 p0 |
| 82 |
3 p1.2 |
| 83 |
2 p1.1 |
| 84 |
1 p2 |
| 85 |
0 p3 |
| 86 |
$ hg log -R darcs-repo-hg -g --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@" |
| 87 |
4 "p3" ([email protected]) files: dir/d dir/d2 dir2/d f ff |
| 88 |
3 "p2" ([email protected]) files: a dir/d dir/d2 f |
| 89 |
2 "p1.1" ([email protected]) files: |
| 90 |
1 "p1.2" ([email protected]) files: a b |
| 91 |
0 "p0" ([email protected]) files: a |
| 92 |
|
| 93 |
$ hg up -q -R darcs-repo-hg |
| 94 |
$ hg -R darcs-repo-hg manifest --debug |
| 95 |
7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a |
| 96 |
1e88685f5ddec574a34c70af492f95b6debc8741 644 b |
| 97 |
37406831adc447ec2385014019599dfec953c806 644 dir2/d |
| 98 |
b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff |
| 99 |
|
| 100 |
#if no-outer-repo |
| 101 |
|
| 102 |
try converting darcs1 repository |
| 103 |
|
| 104 |
$ hg clone -q "$TESTDIR/bundles/darcs1.hg" darcs |
| 105 |
$ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0 |
| 106 |
darcs-1.0 repository format is unsupported, please upgrade |
| 107 |
|
| 108 |
#endif |