annotate tests/test-convert-bzr @ 8148:adce97d28389

convert/bzr: fix symlink handling (issue1626)
author Patrick Mezard <pmezard@gmail.com>
date Fri, 24 Apr 2009 10:34:11 +0200
parents e09a2f2ef85d
children 78658990c725
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
1 #!/bin/sh
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
2
7058
9e6d6568bf7a `source` doesn't work for some /bin/sh, use `.` instead
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7053
diff changeset
3 . "$TESTDIR/bzr-definitions"
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
4
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
5 echo % create and rename on the same file in the same step
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
6 mkdir test-createandrename
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
7 cd test-createandrename
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
8 bzr init -q source
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
9 cd source
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
10 echo a > a
8036
dbcf5d52fcf5 test-convert-bzr: check renamed files are removed (issue1505)
Patrick Mezard <pmezard@gmail.com>
parents: 7058
diff changeset
11 echo c > c
8045
e09a2f2ef85d convert/bzr: fix file rename replaced by a dir case (issue1583)
Patrick Mezard <pmezard@gmail.com>
parents: 8036
diff changeset
12 echo e > e
e09a2f2ef85d convert/bzr: fix file rename replaced by a dir case (issue1583)
Patrick Mezard <pmezard@gmail.com>
parents: 8036
diff changeset
13 bzr add -q a c e
e09a2f2ef85d convert/bzr: fix file rename replaced by a dir case (issue1583)
Patrick Mezard <pmezard@gmail.com>
parents: 8036
diff changeset
14 bzr commit -q -m 'Initial add: a, c, e'
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
15 bzr mv a b
8036
dbcf5d52fcf5 test-convert-bzr: check renamed files are removed (issue1505)
Patrick Mezard <pmezard@gmail.com>
parents: 7058
diff changeset
16 bzr mv c d
8045
e09a2f2ef85d convert/bzr: fix file rename replaced by a dir case (issue1583)
Patrick Mezard <pmezard@gmail.com>
parents: 8036
diff changeset
17 bzr mv e f
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
18 echo a2 >> a
8045
e09a2f2ef85d convert/bzr: fix file rename replaced by a dir case (issue1583)
Patrick Mezard <pmezard@gmail.com>
parents: 8036
diff changeset
19 mkdir e
e09a2f2ef85d convert/bzr: fix file rename replaced by a dir case (issue1583)
Patrick Mezard <pmezard@gmail.com>
parents: 8036
diff changeset
20 bzr add -q a e
8036
dbcf5d52fcf5 test-convert-bzr: check renamed files are removed (issue1505)
Patrick Mezard <pmezard@gmail.com>
parents: 7058
diff changeset
21 bzr commit -q -m 'rename a into b, create a, rename c into d'
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
22 cd ..
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
23 hg convert source source-hg
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
24 glog -R source-hg
8036
dbcf5d52fcf5 test-convert-bzr: check renamed files are removed (issue1505)
Patrick Mezard <pmezard@gmail.com>
parents: 7058
diff changeset
25 echo "% manifest"
dbcf5d52fcf5 test-convert-bzr: check renamed files are removed (issue1505)
Patrick Mezard <pmezard@gmail.com>
parents: 7058
diff changeset
26 hg manifest -R source-hg -r tip
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
27 echo "% test --rev option"
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
28 hg convert -r 1 source source-1-hg
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
29 glog -R source-1-hg
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
30 cd ..
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
31
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
32 echo % merge
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
33 mkdir test-merge
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
34 cd test-merge
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
35
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
36 cat > helper.py <<EOF
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
37 import sys
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
38 from bzrlib import workingtree
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
39 wt = workingtree.WorkingTree.open('.')
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
40
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
41 message, stamp = sys.argv[1:]
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
42 wt.commit(message, timestamp=int(stamp))
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
43 EOF
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
44
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
45 bzr init -q source
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
46 cd source
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
47 echo content > a
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
48 echo content2 > b
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
49 bzr add -q a b
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
50 bzr commit -q -m 'Initial add'
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
51 cd ..
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
52 bzr branch -q source source-improve
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
53 cd source
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
54 echo more >> a
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
55 python ../helper.py 'Editing a' 100
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
56 cd ../source-improve
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
57 echo content3 >> b
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
58 python ../helper.py 'Editing b' 200
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
59 cd ../source
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
60 bzr merge -q ../source-improve
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
61 bzr commit -q -m 'Merged improve branch'
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
62 cd ..
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
63 hg convert --datesort source source-hg
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
64 glog -R source-hg
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
65 cd ..
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
66
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
67 echo % symlinks and executable files
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
68 mkdir test-symlinks
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
69 cd test-symlinks
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
70 bzr init -q source
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
71 cd source
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
72 touch program
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
73 chmod +x program
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
74 ln -s program altname
8148
adce97d28389 convert/bzr: fix symlink handling (issue1626)
Patrick Mezard <pmezard@gmail.com>
parents: 8045
diff changeset
75 mkdir d
adce97d28389 convert/bzr: fix symlink handling (issue1626)
Patrick Mezard <pmezard@gmail.com>
parents: 8045
diff changeset
76 echo a > d/a
adce97d28389 convert/bzr: fix symlink handling (issue1626)
Patrick Mezard <pmezard@gmail.com>
parents: 8045
diff changeset
77 ln -s a syma
adce97d28389 convert/bzr: fix symlink handling (issue1626)
Patrick Mezard <pmezard@gmail.com>
parents: 8045
diff changeset
78 bzr add -q altname program syma d/a
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
79 bzr commit -q -m 'Initial setup'
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
80 touch newprog
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
81 chmod +x newprog
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
82 rm altname
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
83 ln -s newprog altname
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
84 chmod -x program
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
85 bzr add -q newprog
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
86 bzr commit -q -m 'Symlink changed, x bits changed'
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
87 cd ..
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
88 hg convert source source-hg
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
89 manifest source-hg 0
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
90 manifest source-hg tip
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents:
diff changeset
91 cd ..