##// END OF EJS Templates
convert/bzr: test tags conversion
Patrick Mezard -
r16062:718b81e8 default
parent child Browse files
Show More
@@ -1,248 +1,263 b''
1 1 $ "$TESTDIR/hghave" symlink execbit || exit 80
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 $ bzr 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 $ bzr add -q a c e
26 26 $ bzr commit -q -m 'Initial add: a, c, e'
27 27 $ bzr mv a b
28 28 a => b
29 29 $ bzr mv c d
30 30 c => d
31 31 $ bzr mv e f
32 32 e => f
33 33 $ echo a2 >> a
34 34 $ mkdir e
35 35 $ bzr add -q a e
36 36 $ bzr 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: a b c d e f
46 46 |
47 47 o 0@source "Initial add: a, c, e" files: a c e
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
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 $ bzr 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 $ bzr 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 $ 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 bzrlib import workingtree
117 117 > wt = workingtree.WorkingTree.open('.')
118 118 >
119 119 > message, stamp = sys.argv[1:]
120 120 > wt.commit(message, timestamp=int(stamp))
121 121 > EOF
122 122 $ bzr init -q source
123 123 $ cd source
124 124 $ echo content > a
125 125 $ echo content2 > b
126 126 $ bzr add -q a b
127 127 $ bzr commit -q -m 'Initial add'
128 128 $ cd ..
129 129 $ bzr branch -q source source-improve
130 130 $ cd source
131 131 $ echo more >> a
132 132 $ python ../helper.py 'Editing a' 100
133 133 $ cd ../source-improve
134 134 $ echo content3 >> b
135 135 $ python ../helper.py 'Editing b' 200
136 136 $ cd ../source
137 137 $ bzr merge -q ../source-improve
138 138 $ bzr commit -q -m 'Merged improve branch'
139 139 $ cd ..
140 140 $ hg convert --datesort source source-hg
141 141 initializing destination source-hg repository
142 142 scanning source...
143 143 sorting...
144 144 converting...
145 145 3 Initial add
146 146 2 Editing a
147 147 1 Editing b
148 148 0 Merged improve branch
149 149 $ glog -R source-hg
150 150 o 3@source "Merged improve branch" files:
151 151 |\
152 152 | o 2@source-improve "Editing b" files: b
153 153 | |
154 154 o | 1@source "Editing a" files: a
155 155 |/
156 156 o 0@source "Initial add" files: a b
157 157
158 158 $ cd ..
159 159
160 160 symlinks and executable files
161 161
162 162 $ mkdir test-symlinks
163 163 $ cd test-symlinks
164 164 $ bzr init -q source
165 165 $ cd source
166 166 $ touch program
167 167 $ chmod +x program
168 168 $ ln -s program altname
169 169 $ mkdir d
170 170 $ echo a > d/a
171 171 $ ln -s a syma
172 172 $ bzr add -q altname program syma d/a
173 173 $ bzr commit -q -m 'Initial setup'
174 174 $ touch newprog
175 175 $ chmod +x newprog
176 176 $ rm altname
177 177 $ ln -s newprog altname
178 178 $ chmod -x program
179 179 $ bzr add -q newprog
180 180 $ bzr commit -q -m 'Symlink changed, x bits changed'
181 181 $ cd ..
182 182 $ hg convert source source-hg
183 183 initializing destination source-hg repository
184 184 scanning source...
185 185 sorting...
186 186 converting...
187 187 1 Initial setup
188 188 0 Symlink changed, x bits changed
189 189 $ manifest source-hg 0
190 190 % manifest of 0
191 191 644 @ altname
192 192 644 d/a
193 193 755 * program
194 194 644 @ syma
195 195 $ manifest source-hg tip
196 196 % manifest of tip
197 197 644 @ altname
198 198 644 d/a
199 199 755 * newprog
200 200 644 program
201 201 644 @ syma
202 202 $ cd source-hg
203 203
204 204 test the symlinks can be recreated
205 205
206 206 $ hg up
207 207 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 208 $ hg cat syma; echo
209 209 a
210 210
211 211 Multiple branches
212 212
213 213 $ bzr init-repo -q --no-trees repo
214 214 $ bzr init -q repo/trunk
215 215 $ bzr co repo/trunk repo-trunk
216 216 $ cd repo-trunk
217 217 $ echo a > a
218 218 $ bzr add a
219 219 adding a
220 220 $ bzr ci -qm adda --commit-time '2012-01-01 00:00:01 +0000'
221 $ bzr tag trunk-tag
222 Created tag trunk-tag.
221 223 $ bzr switch -b branch
222 224 Tree is up to date at revision 1.
223 225 Switched to branch: *repo/branch/ (glob)
224 226 $ echo b > b
225 227 $ bzr add b
226 228 adding b
227 229 $ bzr ci -qm addb --commit-time '2012-01-01 00:00:02 +0000'
230 $ bzr tag branch-tag
231 Created tag branch-tag.
228 232 $ bzr switch --force ../repo/trunk
229 233 Updated to revision 1.
230 234 Switched to branch: */repo/trunk/ (glob)
231 235 $ echo a >> a
232 236 $ bzr ci -qm changea --commit-time '2012-01-01 00:00:03 +0000'
233 237 $ cd ..
234 238 $ hg convert --datesort repo repo-bzr
235 239 initializing destination repo-bzr repository
236 240 scanning source...
237 241 sorting...
238 242 converting...
239 243 2 adda
240 244 1 addb
241 245 0 changea
246 updating tags
242 247 $ (cd repo-bzr; glog)
248 o 3@default "update tags" files: .hgtags
249 |
243 250 o 2@default "changea" files: a
244 251 |
245 252 | o 1@branch "addb" files: b
246 253 |/
247 254 o 0@default "adda" files: a
248 255
256
257 Test tags (converted identifiers are not stable because bzr ones are
258 not and get incorporated in extra fields).
259
260 $ hg -R repo-bzr tags
261 tip 3:* (glob)
262 branch-tag 1:* (glob)
263 trunk-tag 0:* (glob)
General Comments 0
You need to be logged in to leave comments. Login now