Show More
@@ -1,127 +1,209 b'' | |||
|
1 | #!/bin/sh | |
|
1 | ||
|
2 | $ . "$TESTDIR/bzr-definitions" | |
|
3 | ||
|
4 | create and rename on the same file in the same step | |
|
2 | 5 | |
|
3 | . "$TESTDIR/bzr-definitions" | |
|
6 | $ mkdir test-createandrename | |
|
7 | $ cd test-createandrename | |
|
8 | $ bzr init -q source | |
|
9 | $ cd source | |
|
10 | $ echo a > a | |
|
11 | $ echo c > c | |
|
12 | $ echo e > e | |
|
13 | $ bzr add -q a c e | |
|
14 | $ bzr commit -q -m 'Initial add: a, c, e' | |
|
15 | $ bzr mv a b | |
|
16 | a => b | |
|
17 | $ bzr mv c d | |
|
18 | c => d | |
|
19 | $ bzr mv e f | |
|
20 | e => f | |
|
21 | $ echo a2 >> a | |
|
22 | $ mkdir e | |
|
23 | $ bzr add -q a e | |
|
24 | $ bzr commit -q -m 'rename a into b, create a, rename c into d' | |
|
25 | $ cd .. | |
|
26 | $ hg convert source source-hg | |
|
27 | initializing destination source-hg repository | |
|
28 | scanning source... | |
|
29 | sorting... | |
|
30 | converting... | |
|
31 | 1 Initial add: a, c, e | |
|
32 | 0 rename a into b, create a, rename c into d | |
|
33 | $ glog -R source-hg | |
|
34 | o 1 "rename a into b, create a, rename c into d" files: a b c d e f | |
|
35 | | | |
|
36 | o 0 "Initial add: a, c, e" files: a c e | |
|
37 | ||
|
38 | ||
|
39 | manifest | |
|
40 | ||
|
41 | $ hg manifest -R source-hg -r tip | |
|
42 | a | |
|
43 | b | |
|
44 | d | |
|
45 | f | |
|
46 | ||
|
47 | test --rev option | |
|
4 | 48 | |
|
5 | echo % create and rename on the same file in the same step | |
|
6 | mkdir test-createandrename | |
|
7 | cd test-createandrename | |
|
8 | bzr init -q source | |
|
9 | cd source | |
|
10 | echo a > a | |
|
11 | echo c > c | |
|
12 | echo e > e | |
|
13 | bzr add -q a c e | |
|
14 | bzr commit -q -m 'Initial add: a, c, e' | |
|
15 | bzr mv a b | |
|
16 | bzr mv c d | |
|
17 | bzr mv e f | |
|
18 | echo a2 >> a | |
|
19 | mkdir e | |
|
20 | bzr add -q a e | |
|
21 | bzr commit -q -m 'rename a into b, create a, rename c into d' | |
|
22 | cd .. | |
|
23 | hg convert source source-hg | |
|
24 | glog -R source-hg | |
|
25 | echo "% manifest" | |
|
26 | hg manifest -R source-hg -r tip | |
|
27 | echo "% test --rev option" | |
|
28 | hg convert -r 1 source source-1-hg | |
|
29 | glog -R source-1-hg | |
|
30 | echo "% test with filemap" | |
|
31 | cat > filemap <<EOF | |
|
32 | exclude a | |
|
33 | EOF | |
|
34 | hg convert --filemap filemap source source-filemap-hg | |
|
35 | hg -R source-filemap-hg manifest -r tip | |
|
49 | $ hg convert -r 1 source source-1-hg | |
|
50 | initializing destination source-1-hg repository | |
|
51 | scanning source... | |
|
52 | sorting... | |
|
53 | converting... | |
|
54 | 0 Initial add: a, c, e | |
|
55 | $ glog -R source-1-hg | |
|
56 | o 0 "Initial add: a, c, e" files: a c e | |
|
57 | ||
|
58 | ||
|
59 | test with filemap | |
|
36 | 60 | |
|
37 | echo '% convert from lightweight checkout' | |
|
38 | bzr checkout --lightweight source source-light | |
|
39 | hg convert source-light source-light-hg | |
|
40 | echo "% lightweight manifest" | |
|
41 | hg manifest -R source-light-hg -r tip | |
|
61 | $ cat > filemap <<EOF | |
|
62 | > exclude a | |
|
63 | > EOF | |
|
64 | $ hg convert --filemap filemap source source-filemap-hg | |
|
65 | initializing destination source-filemap-hg repository | |
|
66 | scanning source... | |
|
67 | sorting... | |
|
68 | converting... | |
|
69 | 1 Initial add: a, c, e | |
|
70 | 0 rename a into b, create a, rename c into d | |
|
71 | $ hg -R source-filemap-hg manifest -r tip | |
|
72 | b | |
|
73 | d | |
|
74 | f | |
|
75 | ||
|
76 | convert from lightweight checkout | |
|
42 | 77 | |
|
43 | # extract timestamps that look just like hg's {date|isodate}: | |
|
44 | # yyyy-mm-dd HH:MM zzzz (no seconds!) | |
|
45 | echo "% compare timestamps" | |
|
46 | cd source | |
|
47 | bzr log | \ | |
|
48 | sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \ | |
|
49 | > ../bzr-timestamps | |
|
50 | cd .. | |
|
78 | $ bzr checkout --lightweight source source-light | |
|
79 | $ hg convert source-light source-light-hg | |
|
80 | initializing destination source-light-hg repository | |
|
81 | warning: lightweight checkouts may cause conversion failures, try with a regular branch instead. | |
|
82 | scanning source... | |
|
83 | sorting... | |
|
84 | converting... | |
|
85 | 1 Initial add: a, c, e | |
|
86 | 0 rename a into b, create a, rename c into d | |
|
51 | 87 | |
|
52 | hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps | |
|
53 | if diff -q bzr-timestamps hg-timestamps ; then | |
|
54 | echo "good: hg timestamps match bzr timestamps" | |
|
55 | else | |
|
56 | echo "fail: bzr timestamps are:" | |
|
57 | cat bzr-timestamps | |
|
58 | echo "but hg timestamps are:" | |
|
59 | cat hg-timestamps | |
|
60 | fi | |
|
88 | lightweight manifest | |
|
61 | 89 | |
|
62 | cd .. | |
|
90 | $ hg manifest -R source-light-hg -r tip | |
|
91 | a | |
|
92 | b | |
|
93 | d | |
|
94 | f | |
|
95 | ||
|
96 | extract timestamps that look just like hg's {date|isodate}: | |
|
97 | yyyy-mm-dd HH:MM zzzz (no seconds!) | |
|
98 | compare timestamps | |
|
63 | 99 | |
|
64 | echo % merge | |
|
65 | mkdir test-merge | |
|
66 | cd test-merge | |
|
100 | $ cd source | |
|
101 | $ bzr log | \ | |
|
102 | > sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \ | |
|
103 | > > ../bzr-timestamps | |
|
104 | $ cd .. | |
|
105 | $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps | |
|
106 | $ diff -u bzr-timestamps hg-timestamps | |
|
107 | $ cd .. | |
|
67 | 108 | |
|
68 | cat > helper.py <<EOF | |
|
69 | import sys | |
|
70 | from bzrlib import workingtree | |
|
71 | wt = workingtree.WorkingTree.open('.') | |
|
72 | ||
|
73 | message, stamp = sys.argv[1:] | |
|
74 | wt.commit(message, timestamp=int(stamp)) | |
|
75 | EOF | |
|
109 | merge | |
|
76 | 110 | |
|
77 | bzr init -q source | |
|
78 | cd source | |
|
79 | echo content > a | |
|
80 | echo content2 > b | |
|
81 | bzr add -q a b | |
|
82 | bzr commit -q -m 'Initial add' | |
|
83 | cd .. | |
|
84 | bzr branch -q source source-improve | |
|
85 | cd source | |
|
86 | echo more >> a | |
|
87 | python ../helper.py 'Editing a' 100 | |
|
88 | cd ../source-improve | |
|
89 |
echo content |
|
|
90 | python ../helper.py 'Editing b' 200 | |
|
91 | cd ../source | |
|
92 | bzr merge -q ../source-improve | |
|
93 | bzr commit -q -m 'Merged improve branch' | |
|
94 | cd .. | |
|
95 | hg convert --datesort source source-hg | |
|
96 | glog -R source-hg | |
|
97 | cd .. | |
|
111 | $ mkdir test-merge | |
|
112 | $ cd test-merge | |
|
113 | $ cat > helper.py <<EOF | |
|
114 | > import sys | |
|
115 | > from bzrlib import workingtree | |
|
116 | > wt = workingtree.WorkingTree.open('.') | |
|
117 | > | |
|
118 | > message, stamp = sys.argv[1:] | |
|
119 | > wt.commit(message, timestamp=int(stamp)) | |
|
120 | > EOF | |
|
121 | $ bzr init -q source | |
|
122 | $ cd source | |
|
123 | $ echo content > a | |
|
124 | $ echo content2 > b | |
|
125 | $ bzr add -q a b | |
|
126 | $ bzr commit -q -m 'Initial add' | |
|
127 | $ cd .. | |
|
128 | $ bzr branch -q source source-improve | |
|
129 | $ cd source | |
|
130 | $ echo more >> a | |
|
131 | $ python ../helper.py 'Editing a' 100 | |
|
132 | $ cd ../source-improve | |
|
133 | $ echo content3 >> b | |
|
134 | $ python ../helper.py 'Editing b' 200 | |
|
135 | $ cd ../source | |
|
136 | $ bzr merge -q ../source-improve | |
|
137 | $ bzr commit -q -m 'Merged improve branch' | |
|
138 | $ cd .. | |
|
139 | $ hg convert --datesort source source-hg | |
|
140 | initializing destination source-hg repository | |
|
141 | scanning source... | |
|
142 | sorting... | |
|
143 | converting... | |
|
144 | 3 Initial add | |
|
145 | 2 Editing a | |
|
146 | 1 Editing b | |
|
147 | 0 Merged improve branch | |
|
148 | $ glog -R source-hg | |
|
149 | o 3 "Merged improve branch" files: | |
|
150 | |\ | |
|
151 | | o 2 "Editing b" files: b | |
|
152 | | | | |
|
153 | o | 1 "Editing a" files: a | |
|
154 | |/ | |
|
155 | o 0 "Initial add" files: a b | |
|
156 | ||
|
157 | $ cd .. | |
|
158 | ||
|
159 | symlinks and executable files | |
|
98 | 160 | |
|
99 | echo % symlinks and executable files | |
|
100 |
|
|
|
101 | cd test-symlinks | |
|
102 | bzr init -q source | |
|
103 | cd source | |
|
104 |
|
|
|
105 | chmod +x program | |
|
106 | ln -s program altname | |
|
107 | mkdir d | |
|
108 | echo a > d/a | |
|
109 | ln -s a syma | |
|
110 | bzr add -q altname program syma d/a | |
|
111 | bzr commit -q -m 'Initial setup' | |
|
112 |
|
|
|
113 | chmod +x newprog | |
|
114 | rm altname | |
|
115 | ln -s newprog altname | |
|
116 | chmod -x program | |
|
117 | bzr add -q newprog | |
|
118 | bzr commit -q -m 'Symlink changed, x bits changed' | |
|
119 | cd .. | |
|
120 | hg convert source source-hg | |
|
121 | manifest source-hg 0 | |
|
122 | manifest source-hg tip | |
|
123 | cd source-hg | |
|
124 | echo % test the symlinks can be recreated | |
|
125 | hg up | |
|
126 | hg cat syma | |
|
127 | cd ../.. | |
|
161 | $ mkdir test-symlinks | |
|
162 | $ cd test-symlinks | |
|
163 | $ bzr init -q source | |
|
164 | $ cd source | |
|
165 | $ touch program | |
|
166 | $ chmod +x program | |
|
167 | $ ln -s program altname | |
|
168 | $ mkdir d | |
|
169 | $ echo a > d/a | |
|
170 | $ ln -s a syma | |
|
171 | $ bzr add -q altname program syma d/a | |
|
172 | $ bzr commit -q -m 'Initial setup' | |
|
173 | $ touch newprog | |
|
174 | $ chmod +x newprog | |
|
175 | $ rm altname | |
|
176 | $ ln -s newprog altname | |
|
177 | $ chmod -x program | |
|
178 | $ bzr add -q newprog | |
|
179 | $ bzr commit -q -m 'Symlink changed, x bits changed' | |
|
180 | $ cd .. | |
|
181 | $ hg convert source source-hg | |
|
182 | initializing destination source-hg repository | |
|
183 | scanning source... | |
|
184 | sorting... | |
|
185 | converting... | |
|
186 | 1 Initial setup | |
|
187 | 0 Symlink changed, x bits changed | |
|
188 | $ manifest source-hg 0 | |
|
189 | % manifest of 0 | |
|
190 | 644 @ altname | |
|
191 | 644 d/a | |
|
192 | 755 * program | |
|
193 | 644 @ syma | |
|
194 | $ manifest source-hg tip | |
|
195 | % manifest of tip | |
|
196 | 644 @ altname | |
|
197 | 644 d/a | |
|
198 | 755 * newprog | |
|
199 | 644 program | |
|
200 | 644 @ syma | |
|
201 | $ cd source-hg | |
|
202 | ||
|
203 | test the symlinks can be recreated | |
|
204 | ||
|
205 | $ hg up | |
|
206 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
207 | $ hg cat syma; echo | |
|
208 | a | |
|
209 |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now