Mercurial > hg
annotate tests/test-convert-darcs.t @ 12920:1fab4970354e
keyword: function to look up changectx for expansion
Similarly rename variable in kwtemplater.overwrite().
author | Christian Ebert <blacktrash@gmx.net> |
---|---|
date | Wed, 03 Nov 2010 14:37:41 +0100 |
parents | 372abc799caa |
children | 05fffd665170 |
rev | line source |
---|---|
5413 | 1 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
2 $ "$TESTDIR/hghave" darcs || exit 80 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
3 $ echo "[extensions]" >> $HGRCPATH |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
4 $ echo "convert=" >> $HGRCPATH |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
5 $ echo 'graphlog =' >> $HGRCPATH |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
6 $ DARCS_EMAIL='test@example.org'; export DARCS_EMAIL |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
7 $ HOME=`pwd`/do_not_use_HOME_darcs; export HOME |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
8 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
9 skip if we can't import elementtree |
5413 | 10 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
11 $ mkdir dummy |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
12 $ mkdir dummy/_darcs |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
13 $ if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
14 > echo 'skipped: missing feature: elementtree module' |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
15 > exit 80 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
16 > fi |
5413 | 17 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
18 try converting darcs1 repository |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
19 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
20 $ hg clone -q "$TESTDIR/darcs1.hg" darcs |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
21 $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
22 darcs-1.0 repository format is unsupported, please upgrade |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
23 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
24 initialize darcs repo |
5520
cc3af86ab6fe
test-convert-darcs: skip if we can't find the elementtree module
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5442
diff
changeset
|
25 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
26 $ mkdir darcs-repo |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
27 $ cd darcs-repo |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
28 $ darcs init |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
29 $ echo a > a |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
30 $ darcs record -a -l -m p0 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
31 Finished recording patch 'p0' |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
32 $ cd .. |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
33 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
34 branch and update |
12393
84ceedcfeb6a
convert/darcs: improve unsupported format detection (issue2172)
Patrick Mezard <pmezard@gmail.com>
parents:
12252
diff
changeset
|
35 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
36 $ darcs get darcs-repo darcs-clone >/dev/null |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
37 $ cd darcs-clone |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
38 $ echo c >> a |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
39 $ echo c > c |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
40 $ darcs record -a -l -m p1.1 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
41 Finished recording patch 'p1.1' |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
42 $ cd .. |
5413 | 43 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
44 update source |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
45 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
46 $ cd darcs-repo |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
47 $ echo b >> a |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
48 $ echo b > b |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
49 $ darcs record -a -l -m p1.2 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
50 Finished recording patch 'p1.2' |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
51 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
52 $ darcs pull -a ../darcs-clone |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
53 Backing up ./a(-darcs-backup0) |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
54 We have conflicts in the following files: |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
55 ./a |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
56 Finished pulling and applying. |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
57 $ sleep 1 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
58 $ echo e > a |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
59 $ echo f > f |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
60 $ mkdir dir |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
61 $ echo d > dir/d |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
62 $ echo d > dir/d2 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
63 $ darcs record -a -l -m p2 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
64 Finished recording patch 'p2' |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
65 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
66 test file and directory move |
5413 | 67 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
68 $ darcs mv f ff |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
69 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
70 Test remove + move |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
71 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
72 $ darcs remove dir/d2 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
73 $ rm dir/d2 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
74 $ darcs mv dir dir2 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
75 $ darcs record -a -l -m p3 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
76 Finished recording patch 'p3' |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
77 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
78 test utf-8 commit message and author |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
79 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
80 $ echo g > g |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
81 |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
82 darcs is encoding agnostic, so it takes whatever bytes it's given |
9526
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
83 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
84 $ darcs record -a -l -m 'p4: desc ñ' -A 'author ñ' |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
85 Finished recording patch 'p4: desc ñ' |
12718 | 86 |
87 Test latin-1 commit message | |
5413 | 88 |
12718 | 89 $ echo h > h |
90 $ printf "p5: desc " > ../p5 | |
91 $ python -c 'print "".join([chr(i) for i in range(128, 256)])' >> ../p5 | |
92 $ darcs record -a -l --logfile ../p5 | |
93 Finished recording patch 'p5: desc ' | |
94 | |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
95 $ glog() |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
96 > { |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
97 > HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@" |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
98 > } |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
99 $ cd .. |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
100 $ hg convert darcs-repo darcs-repo-hg |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
101 initializing destination darcs-repo-hg repository |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
102 scanning source... |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
103 sorting... |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
104 converting... |
12718 | 105 6 p0 |
106 5 p1.2 | |
107 4 p1.1 | |
108 3 p2 | |
109 2 p3 | |
110 1 p4: desc ? | |
111 0 p5: desc ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? | |
5413 | 112 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
113 The converter does not currently handle patch conflicts very well. |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
114 When they occur, it reverts *all* changes and moves forward, |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
115 letting the conflict resolving patch fix collisions. |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
116 Unfortunately, non-conflicting changes, like the addition of the |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
117 "c" file in p1.1 patch are reverted too. |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
118 Just to say that manifest not listing "c" here is a bug. |
5413 | 119 |
12718 | 120 $ HGENCODING=latin-1 glog -R darcs-repo-hg -r 6 | "$TESTDIR"/printrepr.py |
121 o 6 "p5: desc \xc2\x80\xc2\x81\xc2\x82\xc2\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3\xbe\xc3\xbf" (test@example.org) files: h | |
122 | | |
123 $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5 | "$TESTDIR"/printrepr.py | |
124 o 5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g | |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
125 | |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
126 o 4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
127 | |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
128 o 3 "p2" (test@example.org) files: a dir/d dir/d2 f |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
129 | |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
130 o 2 "p1.1" (test@example.org) files: |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
131 | |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
132 o 1 "p1.2" (test@example.org) files: a b |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
133 | |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
134 o 0 "p0" (test@example.org) files: a |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
135 |
12718 | 136 |
12524
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
137 $ hg up -q -R darcs-repo-hg |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
138 $ hg -R darcs-repo-hg manifest --debug |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
139 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
140 1e88685f5ddec574a34c70af492f95b6debc8741 644 b |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
141 37406831adc447ec2385014019599dfec953c806 644 dir2/d |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
142 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff |
8773cac3a455
tests: unify test-convert-darcs
Matt Mackall <mpm@selenic.com>
parents:
12407
diff
changeset
|
143 0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644 g |
12718 | 144 fe6f8b4f507fe3eb524c527192a84920a4288dac 644 h |