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