##// END OF EJS Templates
tests: accept new bzr message about switching branches...
Martin von Zweigbergk -
r44827:84d98fa8 stable
parent child Browse files
Show More
@@ -1,288 +1,288 b''
1 #require bzr
1 #require bzr
2
2
3 $ . "$TESTDIR/bzr-definitions"
3 $ . "$TESTDIR/bzr-definitions"
4
4
5 create and rename on the same file in the same step
5 create and rename on the same file in the same step
6
6
7 $ mkdir test-createandrename
7 $ mkdir test-createandrename
8 $ cd test-createandrename
8 $ cd test-createandrename
9 $ bzr init -q source
9 $ bzr init -q source
10
10
11 test empty repo conversion (issue3233)
11 test empty repo conversion (issue3233)
12
12
13 $ hg convert source source-hg
13 $ hg convert source source-hg
14 initializing destination source-hg repository
14 initializing destination source-hg repository
15 scanning source...
15 scanning source...
16 sorting...
16 sorting...
17 converting...
17 converting...
18
18
19 back to the rename stuff
19 back to the rename stuff
20
20
21 $ cd source
21 $ cd source
22 $ echo a > a
22 $ echo a > a
23 $ echo c > c
23 $ echo c > c
24 $ echo e > e
24 $ echo e > e
25 $ bzr add -q a c e
25 $ bzr add -q a c e
26 $ bzr commit -q -m 'Initial add: a, c, e'
26 $ bzr commit -q -m 'Initial add: a, c, e'
27 $ bzr mv a b
27 $ bzr mv a b
28 a => b
28 a => b
29 $ bzr mv c d
29 $ bzr mv c d
30 c => d
30 c => d
31 $ bzr mv e f
31 $ bzr mv e f
32 e => f
32 e => f
33 $ echo a2 >> a
33 $ echo a2 >> a
34 $ mkdir e
34 $ mkdir e
35 $ bzr add -q a e
35 $ bzr add -q a e
36 $ bzr commit -q -m 'rename a into b, create a, rename c into d'
36 $ bzr commit -q -m 'rename a into b, create a, rename c into d'
37 $ cd ..
37 $ cd ..
38 $ hg convert source source-hg
38 $ hg convert source source-hg
39 scanning source...
39 scanning source...
40 sorting...
40 sorting...
41 converting...
41 converting...
42 1 Initial add: a, c, e
42 1 Initial add: a, c, e
43 0 rename a into b, create a, rename c into d
43 0 rename a into b, create a, rename c into d
44 $ glog -R source-hg
44 $ glog -R source-hg
45 o 1@source "rename a into b, create a, rename c into d" files+: [b d f], files-: [c e], files: [a]
45 o 1@source "rename a into b, create a, rename c into d" files+: [b d f], files-: [c e], files: [a]
46 |
46 |
47 o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: []
47 o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: []
48
48
49
49
50 manifest
50 manifest
51
51
52 $ hg manifest -R source-hg -r tip
52 $ hg manifest -R source-hg -r tip
53 a
53 a
54 b
54 b
55 d
55 d
56 f
56 f
57
57
58 test --rev option
58 test --rev option
59
59
60 $ hg convert -r 1 source source-1-hg
60 $ hg convert -r 1 source source-1-hg
61 initializing destination source-1-hg repository
61 initializing destination source-1-hg repository
62 scanning source...
62 scanning source...
63 sorting...
63 sorting...
64 converting...
64 converting...
65 0 Initial add: a, c, e
65 0 Initial add: a, c, e
66 $ glog -R source-1-hg
66 $ glog -R source-1-hg
67 o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: []
67 o 0@source "Initial add: a, c, e" files+: [a c e], files-: [], files: []
68
68
69
69
70 test with filemap
70 test with filemap
71
71
72 $ cat > filemap <<EOF
72 $ cat > filemap <<EOF
73 > exclude a
73 > exclude a
74 > EOF
74 > EOF
75 $ hg convert --filemap filemap source source-filemap-hg
75 $ hg convert --filemap filemap source source-filemap-hg
76 initializing destination source-filemap-hg repository
76 initializing destination source-filemap-hg repository
77 scanning source...
77 scanning source...
78 sorting...
78 sorting...
79 converting...
79 converting...
80 1 Initial add: a, c, e
80 1 Initial add: a, c, e
81 0 rename a into b, create a, rename c into d
81 0 rename a into b, create a, rename c into d
82 $ hg -R source-filemap-hg manifest -r tip
82 $ hg -R source-filemap-hg manifest -r tip
83 b
83 b
84 d
84 d
85 f
85 f
86
86
87 convert from lightweight checkout
87 convert from lightweight checkout
88
88
89 $ bzr checkout --lightweight source source-light
89 $ bzr checkout --lightweight source source-light
90 $ hg convert -s bzr source-light source-light-hg
90 $ hg convert -s bzr source-light source-light-hg
91 initializing destination source-light-hg repository
91 initializing destination source-light-hg repository
92 warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
92 warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
93 $TESTTMP/test-createandrename/source-light does not look like a Bazaar repository
93 $TESTTMP/test-createandrename/source-light does not look like a Bazaar repository
94 abort: source-light: missing or unsupported repository
94 abort: source-light: missing or unsupported repository
95 [255]
95 [255]
96
96
97 extract timestamps that look just like hg's {date|isodate}:
97 extract timestamps that look just like hg's {date|isodate}:
98 yyyy-mm-dd HH:MM zzzz (no seconds!)
98 yyyy-mm-dd HH:MM zzzz (no seconds!)
99 compare timestamps
99 compare timestamps
100
100
101 $ cd source
101 $ cd source
102 $ bzr log | \
102 $ bzr log | \
103 > sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \
103 > sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \
104 > > ../bzr-timestamps
104 > > ../bzr-timestamps
105 $ cd ..
105 $ cd ..
106 $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
106 $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
107 $ cmp bzr-timestamps hg-timestamps || diff -u bzr-timestamps hg-timestamps
107 $ cmp bzr-timestamps hg-timestamps || diff -u bzr-timestamps hg-timestamps
108 $ cd ..
108 $ cd ..
109
109
110 merge
110 merge
111
111
112 $ mkdir test-merge
112 $ mkdir test-merge
113 $ cd test-merge
113 $ cd test-merge
114 $ cat > helper.py <<EOF
114 $ cat > helper.py <<EOF
115 > import sys
115 > import sys
116 > from bzrlib import workingtree
116 > from bzrlib import workingtree
117 > wt = workingtree.WorkingTree.open('.')
117 > wt = workingtree.WorkingTree.open('.')
118 >
118 >
119 > message, stamp = sys.argv[1:]
119 > message, stamp = sys.argv[1:]
120 > wt.commit(message, timestamp=int(stamp))
120 > wt.commit(message, timestamp=int(stamp))
121 > EOF
121 > EOF
122 $ bzr init -q source
122 $ bzr init -q source
123 $ cd source
123 $ cd source
124 $ echo content > a
124 $ echo content > a
125 $ echo content2 > b
125 $ echo content2 > b
126 $ bzr add -q a b
126 $ bzr add -q a b
127 $ bzr commit -q -m 'Initial add'
127 $ bzr commit -q -m 'Initial add'
128 $ cd ..
128 $ cd ..
129 $ bzr branch -q source source-improve
129 $ bzr branch -q source source-improve
130 $ cd source
130 $ cd source
131 $ echo more >> a
131 $ echo more >> a
132 $ "$PYTHON" ../helper.py 'Editing a' 100
132 $ "$PYTHON" ../helper.py 'Editing a' 100
133 $ cd ../source-improve
133 $ cd ../source-improve
134 $ echo content3 >> b
134 $ echo content3 >> b
135 $ "$PYTHON" ../helper.py 'Editing b' 200
135 $ "$PYTHON" ../helper.py 'Editing b' 200
136 $ cd ../source
136 $ cd ../source
137 $ bzr merge -q ../source-improve
137 $ bzr merge -q ../source-improve
138 $ bzr commit -q -m 'Merged improve branch'
138 $ bzr commit -q -m 'Merged improve branch'
139 $ cd ..
139 $ cd ..
140 $ hg convert --datesort source source-hg
140 $ hg convert --datesort source source-hg
141 initializing destination source-hg repository
141 initializing destination source-hg repository
142 scanning source...
142 scanning source...
143 sorting...
143 sorting...
144 converting...
144 converting...
145 3 Initial add
145 3 Initial add
146 2 Editing a
146 2 Editing a
147 1 Editing b
147 1 Editing b
148 0 Merged improve branch
148 0 Merged improve branch
149 $ glog -R source-hg
149 $ glog -R source-hg
150 o 3@source "Merged improve branch" files+: [], files-: [], files: []
150 o 3@source "Merged improve branch" files+: [], files-: [], files: []
151 |\
151 |\
152 | o 2@source-improve "Editing b" files+: [], files-: [], files: [b]
152 | o 2@source-improve "Editing b" files+: [], files-: [], files: [b]
153 | |
153 | |
154 o | 1@source "Editing a" files+: [], files-: [], files: [a]
154 o | 1@source "Editing a" files+: [], files-: [], files: [a]
155 |/
155 |/
156 o 0@source "Initial add" files+: [a b], files-: [], files: []
156 o 0@source "Initial add" files+: [a b], files-: [], files: []
157
157
158 $ cd ..
158 $ cd ..
159
159
160 #if symlink execbit
160 #if symlink execbit
161
161
162 symlinks and executable files
162 symlinks and executable files
163
163
164 $ mkdir test-symlinks
164 $ mkdir test-symlinks
165 $ cd test-symlinks
165 $ cd test-symlinks
166 $ bzr init -q source
166 $ bzr init -q source
167 $ cd source
167 $ cd source
168 $ touch program
168 $ touch program
169 $ chmod +x program
169 $ chmod +x program
170 $ ln -s program altname
170 $ ln -s program altname
171 $ mkdir d
171 $ mkdir d
172 $ echo a > d/a
172 $ echo a > d/a
173 $ ln -s a syma
173 $ ln -s a syma
174 $ bzr add -q altname program syma d/a
174 $ bzr add -q altname program syma d/a
175 $ bzr commit -q -m 'Initial setup'
175 $ bzr commit -q -m 'Initial setup'
176 $ touch newprog
176 $ touch newprog
177 $ chmod +x newprog
177 $ chmod +x newprog
178 $ rm altname
178 $ rm altname
179 $ ln -s newprog altname
179 $ ln -s newprog altname
180 $ chmod -x program
180 $ chmod -x program
181 $ bzr add -q newprog
181 $ bzr add -q newprog
182 $ bzr commit -q -m 'Symlink changed, x bits changed'
182 $ bzr commit -q -m 'Symlink changed, x bits changed'
183 $ cd ..
183 $ cd ..
184 $ hg convert source source-hg
184 $ hg convert source source-hg
185 initializing destination source-hg repository
185 initializing destination source-hg repository
186 scanning source...
186 scanning source...
187 sorting...
187 sorting...
188 converting...
188 converting...
189 1 Initial setup
189 1 Initial setup
190 0 Symlink changed, x bits changed
190 0 Symlink changed, x bits changed
191 $ manifest source-hg 0
191 $ manifest source-hg 0
192 % manifest of 0
192 % manifest of 0
193 644 @ altname
193 644 @ altname
194 644 d/a
194 644 d/a
195 755 * program
195 755 * program
196 644 @ syma
196 644 @ syma
197 $ manifest source-hg tip
197 $ manifest source-hg tip
198 % manifest of tip
198 % manifest of tip
199 644 @ altname
199 644 @ altname
200 644 d/a
200 644 d/a
201 755 * newprog
201 755 * newprog
202 644 program
202 644 program
203 644 @ syma
203 644 @ syma
204
204
205 test the symlinks can be recreated
205 test the symlinks can be recreated
206
206
207 $ cd source-hg
207 $ cd source-hg
208 $ hg up
208 $ hg up
209 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 $ hg cat syma; echo
210 $ hg cat syma; echo
211 a
211 a
212 $ cd ../..
212 $ cd ../..
213
213
214 #endif
214 #endif
215
215
216 Multiple branches
216 Multiple branches
217
217
218 $ bzr init-repo -q --no-trees repo
218 $ bzr init-repo -q --no-trees repo
219 $ bzr init -q repo/trunk
219 $ bzr init -q repo/trunk
220 $ bzr co repo/trunk repo-trunk
220 $ bzr co repo/trunk repo-trunk
221 $ cd repo-trunk
221 $ cd repo-trunk
222 $ echo a > a
222 $ echo a > a
223 $ bzr add -q a
223 $ bzr add -q a
224 $ bzr ci -qm adda
224 $ bzr ci -qm adda
225 $ bzr tag trunk-tag
225 $ bzr tag trunk-tag
226 Created tag trunk-tag.
226 Created tag trunk-tag.
227 $ bzr switch -b branch
227 $ bzr switch -b branch
228 Tree is up to date at revision 1.
228 Tree is up to date at revision 1.
229 Switched to branch: *repo/branch/ (glob)
229 Switched to branch*repo/branch/ (glob)
230 $ sleep 1
230 $ sleep 1
231 $ echo b > b
231 $ echo b > b
232 $ bzr add -q b
232 $ bzr add -q b
233 $ bzr ci -qm addb
233 $ bzr ci -qm addb
234 $ bzr tag branch-tag
234 $ bzr tag branch-tag
235 Created tag branch-tag.
235 Created tag branch-tag.
236 $ bzr switch --force ../repo/trunk
236 $ bzr switch --force ../repo/trunk
237 Updated to revision 1.
237 Updated to revision 1.
238 Switched to branch: */repo/trunk/ (glob)
238 Switched to branch*/repo/trunk/ (glob)
239 $ sleep 1
239 $ sleep 1
240 $ echo a >> a
240 $ echo a >> a
241 $ bzr ci -qm changea
241 $ bzr ci -qm changea
242 $ cd ..
242 $ cd ..
243 $ hg convert --datesort repo repo-bzr
243 $ hg convert --datesort repo repo-bzr
244 initializing destination repo-bzr repository
244 initializing destination repo-bzr repository
245 scanning source...
245 scanning source...
246 sorting...
246 sorting...
247 converting...
247 converting...
248 2 adda
248 2 adda
249 1 addb
249 1 addb
250 0 changea
250 0 changea
251 updating tags
251 updating tags
252 $ (cd repo-bzr; glog)
252 $ (cd repo-bzr; glog)
253 o 3@default "update tags" files+: [.hgtags], files-: [], files: []
253 o 3@default "update tags" files+: [.hgtags], files-: [], files: []
254 |
254 |
255 o 2@default "changea" files+: [], files-: [], files: [a]
255 o 2@default "changea" files+: [], files-: [], files: [a]
256 |
256 |
257 | o 1@branch "addb" files+: [b], files-: [], files: []
257 | o 1@branch "addb" files+: [b], files-: [], files: []
258 |/
258 |/
259 o 0@default "adda" files+: [a], files-: [], files: []
259 o 0@default "adda" files+: [a], files-: [], files: []
260
260
261
261
262 Test tags (converted identifiers are not stable because bzr ones are
262 Test tags (converted identifiers are not stable because bzr ones are
263 not and get incorporated in extra fields).
263 not and get incorporated in extra fields).
264
264
265 $ hg -R repo-bzr tags
265 $ hg -R repo-bzr tags
266 tip 3:* (glob)
266 tip 3:* (glob)
267 branch-tag 1:* (glob)
267 branch-tag 1:* (glob)
268 trunk-tag 0:* (glob)
268 trunk-tag 0:* (glob)
269
269
270 Nested repositories (issue3254)
270 Nested repositories (issue3254)
271
271
272 $ bzr init-repo -q --no-trees repo/inner
272 $ bzr init-repo -q --no-trees repo/inner
273 $ bzr init -q repo/inner/trunk
273 $ bzr init -q repo/inner/trunk
274 $ bzr co repo/inner/trunk inner-trunk
274 $ bzr co repo/inner/trunk inner-trunk
275 $ cd inner-trunk
275 $ cd inner-trunk
276 $ echo b > b
276 $ echo b > b
277 $ bzr add -q b
277 $ bzr add -q b
278 $ bzr ci -qm addb
278 $ bzr ci -qm addb
279 $ cd ..
279 $ cd ..
280 $ hg convert --datesort repo noinner-bzr
280 $ hg convert --datesort repo noinner-bzr
281 initializing destination noinner-bzr repository
281 initializing destination noinner-bzr repository
282 scanning source...
282 scanning source...
283 sorting...
283 sorting...
284 converting...
284 converting...
285 2 adda
285 2 adda
286 1 addb
286 1 addb
287 0 changea
287 0 changea
288 updating tags
288 updating tags
General Comments 0
You need to be logged in to leave comments. Login now