annotate tests/test-convert-darcs @ 5520:cc3af86ab6fe

test-convert-darcs: skip if we can't find the elementtree module This patch is a bit dirty to avoid having to repeat the dance required to import elementtree.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 09 Nov 2007 20:21:35 -0200
parents a19167001251
children f29b7c8419cb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5413
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 #!/bin/sh
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 "$TESTDIR/hghave" darcs || exit 80
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5 echo "[extensions]" >> $HGRCPATH
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 echo "convert=" >> $HGRCPATH
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 echo 'hgext.graphlog =' >> $HGRCPATH
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9 DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
5442
a19167001251 test-convert-darcs: don't let $HOME/.darcs pollute the test environment
Bryan O'Sullivan <bos@serpentine.com>
parents: 5413
diff changeset
10 HOME=do_not_use_HOME_darcs; export HOME
5413
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11
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
12 # skip if we can't import elementtree
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
13 mkdir dummy
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
14 mkdir dummy/_darcs
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
15 if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
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
16 echo 'hghave: missing feature: elementtree module'
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
17 exit 80
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
18 fi
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
19
5413
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 echo % initialize darcs repo
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 mkdir darcs-repo
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 cd darcs-repo
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 darcs init
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 echo a > a
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 darcs record -a -l -m p0
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 cd ..
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28 echo % branch and update
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 darcs get darcs-repo darcs-clone
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 cd darcs-clone
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31 echo c >> a
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 echo c > c
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
33 darcs record -a -l -m p1.1
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34 cd ..
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
35
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 echo % update source
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
37 cd darcs-repo
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
38 echo b >> a
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
39 echo b > b
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
40 darcs record -a -l -m p1.2
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
41
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
42 echo % merge branch
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
43 darcs pull -a ../darcs-clone
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
44 echo e > a
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
45 darcs record -a -l -m p2
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
46 cd ..
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
47
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
48 glog()
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
49 {
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
50 hg glog --template '#rev# "#desc|firstline#" files: #files#\n' "$@"
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51 }
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
52
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
53 hg convert darcs-repo darcs-repo-hg
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
54 # The converter does not currently handle patch conflicts very well.
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
55 # When they occur, it reverts *all* changes and moves forward,
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
56 # letting the conflict resolving patch fix collisions.
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
57 # Unfortunately, non-conflicting changes, like the addition of the
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
58 # "c" file in p1.1 patch are reverted too.
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
59 # Just to say that manifest not listing "c" here is a bug.
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
60 glog -R darcs-repo-hg
719fd175181f Test darcs converter
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
61 hg -R darcs-repo-hg manifest --debug