comparison tests/test-convert-bzr.t @ 16060:f84dda152a55

convert/bzr: convert all branches (issue3229) (BC) Instead of opening the target bzr checkout as a single branch, we try to open it as a repository. This has the following effects: - All branches are now converted - bzr branch names are preserved. Previously, the selected branch was always converted as 'default'. Branches without a name or 'trunk' are mapped to 'default branch. - Lightweight checkouts are no longer supported. Maybe they can be, I did not try to fix that at all. Implementation notes: - This was a quick fix, I have no knowledge of bzr API besides browsing 2.0.3 sources. - The fix was only tested on OSX against bzr 2.4.2. - Tags discovery does not handle collisions. I have no idea how tags work in bzr so maybe such collisions are not possible.
author Patrick Mezard <pmezard@gmail.com>
date Thu, 02 Feb 2012 10:15:12 +0100
parents db0340f4b507
children 915e06faa8f3
comparison
equal deleted inserted replaced
16059:f5b6046f6ce8 16060:f84dda152a55
30 sorting... 30 sorting...
31 converting... 31 converting...
32 1 Initial add: a, c, e 32 1 Initial add: a, c, e
33 0 rename a into b, create a, rename c into d 33 0 rename a into b, create a, rename c into d
34 $ glog -R source-hg 34 $ glog -R source-hg
35 o 1 "rename a into b, create a, rename c into d" files: a b c d e f 35 o 1@source "rename a into b, create a, rename c into d" files: a b c d e f
36 | 36 |
37 o 0 "Initial add: a, c, e" files: a c e 37 o 0@source "Initial add: a, c, e" files: a c e
38 38
39 39
40 manifest 40 manifest
41 41
42 $ hg manifest -R source-hg -r tip 42 $ hg manifest -R source-hg -r tip
52 scanning source... 52 scanning source...
53 sorting... 53 sorting...
54 converting... 54 converting...
55 0 Initial add: a, c, e 55 0 Initial add: a, c, e
56 $ glog -R source-1-hg 56 $ glog -R source-1-hg
57 o 0 "Initial add: a, c, e" files: a c e 57 o 0@source "Initial add: a, c, e" files: a c e
58 58
59 59
60 test with filemap 60 test with filemap
61 61
62 $ cat > filemap <<EOF 62 $ cat > filemap <<EOF
75 f 75 f
76 76
77 convert from lightweight checkout 77 convert from lightweight checkout
78 78
79 $ bzr checkout --lightweight source source-light 79 $ bzr checkout --lightweight source source-light
80 $ hg convert source-light source-light-hg 80 $ hg convert -s bzr source-light source-light-hg
81 initializing destination source-light-hg repository 81 initializing destination source-light-hg repository
82 warning: lightweight checkouts may cause conversion failures, try with a regular branch instead. 82 warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
83 scanning source... 83 $TESTTMP/test-createandrename/source-light does not look like a Bazaar repository
84 sorting... 84 abort: source-light: missing or unsupported repository
85 converting... 85 [255]
86 1 Initial add: a, c, e
87 0 rename a into b, create a, rename c into d
88
89 lightweight manifest
90
91 $ hg manifest -R source-light-hg -r tip
92 a
93 b
94 d
95 f
96 86
97 extract timestamps that look just like hg's {date|isodate}: 87 extract timestamps that look just like hg's {date|isodate}:
98 yyyy-mm-dd HH:MM zzzz (no seconds!) 88 yyyy-mm-dd HH:MM zzzz (no seconds!)
99 compare timestamps 89 compare timestamps
100 90
145 3 Initial add 135 3 Initial add
146 2 Editing a 136 2 Editing a
147 1 Editing b 137 1 Editing b
148 0 Merged improve branch 138 0 Merged improve branch
149 $ glog -R source-hg 139 $ glog -R source-hg
150 o 3 "Merged improve branch" files: 140 o 3@source "Merged improve branch" files:
151 |\ 141 |\
152 | o 2 "Editing b" files: b 142 | o 2@source-improve "Editing b" files: b
153 | | 143 | |
154 o | 1 "Editing a" files: a 144 o | 1@source "Editing a" files: a
155 |/ 145 |/
156 o 0 "Initial add" files: a b 146 o 0@source "Initial add" files: a b
157 147
158 $ cd .. 148 $ cd ..
159 149
160 symlinks and executable files 150 symlinks and executable files
161 151
206 $ hg up 196 $ hg up
207 5 files updated, 0 files merged, 0 files removed, 0 files unresolved 197 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 $ hg cat syma; echo 198 $ hg cat syma; echo
209 a 199 a
210 200
201 Multiple branches
202
203 $ bzr init-repo -q --no-trees repo
204 $ bzr init -q repo/trunk
205 $ bzr co repo/trunk repo-trunk
206 $ cd repo-trunk
207 $ echo a > a
208 $ bzr add a
209 adding a
210 $ bzr ci -qm adda --commit-time '2012-01-01 00:00:01 +0000'
211 $ bzr switch -b branch
212 Tree is up to date at revision 1.
213 Switched to branch: *repo/branch/ (glob)
214 $ echo b > b
215 $ bzr add b
216 adding b
217 $ bzr ci -qm addb --commit-time '2012-01-01 00:00:02 +0000'
218 $ bzr switch --force ../repo/trunk
219 Updated to revision 1.
220 Switched to branch: */repo/trunk/ (glob)
221 $ echo a >> a
222 $ bzr ci -qm changea --commit-time '2012-01-01 00:00:03 +0000'
223 $ cd ..
224 $ hg convert --datesort repo repo-bzr
225 initializing destination repo-bzr repository
226 scanning source...
227 sorting...
228 converting...
229 2 adda
230 1 addb
231 0 changea
232 $ (cd repo-bzr; glog)
233 o 2@default "changea" files: a
234 |
235 | o 1@branch "addb" files: b
236 |/
237 o 0@default "adda" files: a
238