##// END OF EJS Templates
convert-bazaar: use breezy package instead of old bzr one...
Raphaël Gomès -
r48168:26127236 default
parent child Browse files
Show More
@@ -23,7 +23,7 b' import testparseutil'
23 23 # Whitelist of modules that symbols can be directly imported from.
24 24 allowsymbolimports = (
25 25 '__future__',
26 'bzrlib',
26 'breezy',
27 27 'hgclient',
28 28 'mercurial',
29 29 'mercurial.hgweb.common',
@@ -5,8 +5,9 b''
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 # This module is for handling 'bzr', that was formerly known as Bazaar-NG;
9 # it cannot access 'bar' repositories, but they were never used very much
8 # This module is for handling Breezy imports or `brz`, but it's also compatible
9 # with Bazaar or `bzr`, that was formerly known as Bazaar-NG;
10 # it cannot access `bar` repositories, but they were never used very much.
10 11 from __future__ import absolute_import
11 12
12 13 import os
@@ -19,31 +20,32 b' from mercurial import ('
19 20 )
20 21 from . import common
21 22
23
22 24 # these do not work with demandimport, blacklist
23 25 demandimport.IGNORES.update(
24 26 [
25 b'bzrlib.transactions',
26 b'bzrlib.urlutils',
27 b'breezy.transactions',
28 b'breezy.urlutils',
27 29 b'ElementPath',
28 30 ]
29 31 )
30 32
31 33 try:
32 34 # bazaar imports
33 import bzrlib.bzrdir
34 import bzrlib.errors
35 import bzrlib.revision
36 import bzrlib.revisionspec
35 import breezy.bzr.bzrdir
36 import breezy.errors
37 import breezy.revision
38 import breezy.revisionspec
37 39
38 bzrdir = bzrlib.bzrdir
39 errors = bzrlib.errors
40 revision = bzrlib.revision
41 revisionspec = bzrlib.revisionspec
40 bzrdir = breezy.bzr.bzrdir
41 errors = breezy.errors
42 revision = breezy.revision
43 revisionspec = breezy.revisionspec
42 44 revisionspec.RevisionSpec
43 45 except ImportError:
44 46 pass
45 47
46 supportedkinds = (b'file', b'symlink')
48 supportedkinds = ('file', 'symlink')
47 49
48 50
49 51 class bzr_source(common.converter_source):
@@ -58,7 +60,7 b' class bzr_source(common.converter_source'
58 60 )
59 61
60 62 try:
61 # access bzrlib stuff
63 # access breezy stuff
62 64 bzrdir
63 65 except NameError:
64 66 raise common.NoRepo(_(b'Bazaar modules could not be loaded'))
@@ -66,7 +68,8 b' class bzr_source(common.converter_source'
66 68 path = os.path.abspath(path)
67 69 self._checkrepotype(path)
68 70 try:
69 self.sourcerepo = bzrdir.BzrDir.open(path).open_repository()
71 bzr_dir = bzrdir.BzrDir.open(path.decode())
72 self.sourcerepo = bzr_dir.open_repository()
70 73 except errors.NoRepositoryPresent:
71 74 raise common.NoRepo(
72 75 _(b'%s does not look like a Bazaar repository') % path
@@ -78,7 +81,7 b' class bzr_source(common.converter_source'
78 81 # Lightweight checkouts detection is informational but probably
79 82 # fragile at API level. It should not terminate the conversion.
80 83 try:
81 dir = bzrdir.BzrDir.open_containing(path)[0]
84 dir = bzrdir.BzrDir.open_containing(path.decode())[0]
82 85 try:
83 86 tree = dir.open_workingtree(recommend_upgrade=False)
84 87 branch = tree.branch
@@ -87,8 +90,8 b' class bzr_source(common.converter_source'
87 90 branch = dir.open_branch()
88 91 if (
89 92 tree is not None
90 and tree.bzrdir.root_transport.base
91 != branch.bzrdir.root_transport.base
93 and tree.controldir.root_transport.base
94 != branch.controldir.root_transport.base
92 95 ):
93 96 self.ui.warn(
94 97 _(
@@ -127,7 +130,8 b' class bzr_source(common.converter_source'
127 130 revid = None
128 131 for branch in self._bzrbranches():
129 132 try:
130 r = revisionspec.RevisionSpec.from_string(self.revs[0])
133 revspec = self.revs[0].decode()
134 r = revisionspec.RevisionSpec.from_string(revspec)
131 135 info = r.in_history(branch)
132 136 except errors.BzrError:
133 137 pass
@@ -142,24 +146,26 b' class bzr_source(common.converter_source'
142 146 return heads
143 147
144 148 def getfile(self, name, rev):
149 name = name.decode()
145 150 revtree = self.sourcerepo.revision_tree(rev)
146 fileid = revtree.path2id(name.decode(self.encoding or b'utf-8'))
147 kind = None
148 if fileid is not None:
149 kind = revtree.kind(fileid)
151
152 try:
153 kind = revtree.kind(name)
154 except breezy.errors.NoSuchFile:
155 return None, None
150 156 if kind not in supportedkinds:
151 157 # the file is not available anymore - was deleted
152 158 return None, None
153 mode = self._modecache[(name, rev)]
154 if kind == b'symlink':
155 target = revtree.get_symlink_target(fileid)
159 mode = self._modecache[(name.encode(), rev)]
160 if kind == 'symlink':
161 target = revtree.get_symlink_target(name)
156 162 if target is None:
157 163 raise error.Abort(
158 164 _(b'%s.%s symlink has no target') % (name, rev)
159 165 )
160 return target, mode
166 return target.encode(), mode
161 167 else:
162 sio = revtree.get_file(fileid)
168 sio = revtree.get_file(name)
163 169 return sio.read(), mode
164 170
165 171 def getchanges(self, version, full):
@@ -184,15 +190,15 b' class bzr_source(common.converter_source'
184 190 parents = self._filterghosts(rev.parent_ids)
185 191 self._parentids[version] = parents
186 192
187 branch = self.recode(rev.properties.get(b'branch-nick', u'default'))
188 if branch == b'trunk':
189 branch = b'default'
193 branch = rev.properties.get('branch-nick', 'default')
194 if branch == 'trunk':
195 branch = 'default'
190 196 return common.commit(
191 197 parents=parents,
192 198 date=b'%d %d' % (rev.timestamp, -rev.timezone),
193 199 author=self.recode(rev.committer),
194 200 desc=self.recode(rev.message),
195 branch=branch,
201 branch=branch.encode('utf8'),
196 202 rev=version,
197 203 saverev=self._saverev,
198 204 )
@@ -234,35 +240,32 b' class bzr_source(common.converter_source'
234 240
235 241 # Process the entries by reverse lexicographic name order to
236 242 # handle nested renames correctly, most specific first.
243
244 def key(c):
245 return c.path[0] or c.path[1] or ""
246
237 247 curchanges = sorted(
238 248 current.iter_changes(origin),
239 key=lambda c: c[1][0] or c[1][1],
249 key=key,
240 250 reverse=True,
241 251 )
242 for (
243 fileid,
244 paths,
245 changed_content,
246 versioned,
247 parent,
248 name,
249 kind,
250 executable,
251 ) in curchanges:
252
252 for change in curchanges:
253 paths = change.path
254 kind = change.kind
255 executable = change.executable
253 256 if paths[0] == u'' or paths[1] == u'':
254 257 # ignore changes to tree root
255 258 continue
256 259
257 260 # bazaar tracks directories, mercurial does not, so
258 261 # we have to rename the directory contents
259 if kind[1] == b'directory':
260 if kind[0] not in (None, b'directory'):
262 if kind[1] == 'directory':
263 if kind[0] not in (None, 'directory'):
261 264 # Replacing 'something' with a directory, record it
262 265 # so it can be removed.
263 266 changes.append((self.recode(paths[0]), revid))
264 267
265 if kind[0] == b'directory' and None not in paths:
268 if kind[0] == 'directory' and None not in paths:
266 269 renaming = paths[0] != paths[1]
267 270 # neither an add nor an delete - a move
268 271 # rename all directory contents manually
@@ -270,9 +273,9 b' class bzr_source(common.converter_source'
270 273 # get all child-entries of the directory
271 274 for name, entry in inventory.iter_entries(subdir):
272 275 # hg does not track directory renames
273 if entry.kind == b'directory':
276 if entry.kind == 'directory':
274 277 continue
275 frompath = self.recode(paths[0] + b'/' + name)
278 frompath = self.recode(paths[0] + '/' + name)
276 279 if frompath in seen:
277 280 # Already handled by a more specific change entry
278 281 # This is important when you have:
@@ -283,14 +286,14 b' class bzr_source(common.converter_source'
283 286 seen.add(frompath)
284 287 if not renaming:
285 288 continue
286 topath = self.recode(paths[1] + b'/' + name)
289 topath = self.recode(paths[1] + '/' + name)
287 290 # register the files as changed
288 291 changes.append((frompath, revid))
289 292 changes.append((topath, revid))
290 293 # add to mode cache
291 294 mode = (
292 295 (entry.executable and b'x')
293 or (entry.kind == b'symlink' and b's')
296 or (entry.kind == 'symlink' and b's')
294 297 or b''
295 298 )
296 299 self._modecache[(topath, revid)] = mode
@@ -320,7 +323,7 b' class bzr_source(common.converter_source'
320 323
321 324 # populate the mode cache
322 325 kind, executable = [e[1] for e in (kind, executable)]
323 mode = (executable and b'x') or (kind == b'symlink' and b'l') or b''
326 mode = (executable and b'x') or (kind == 'symlink' and b'l') or b''
324 327 self._modecache[(topath, revid)] = mode
325 328 changes.append((topath, revid))
326 329
@@ -168,35 +168,25 b' def has_baz():'
168 168 return matchoutput('baz --version 2>&1', br'baz Bazaar version')
169 169
170 170
171 @check("bzr", "Canonical's Bazaar client")
171 @check("bzr", "Breezy library and executable version >= 3.1")
172 172 def has_bzr():
173 173 if not is_not_python2:
174 174 return False
175 175 try:
176 import bzrlib
177 import bzrlib.bzrdir
178 import bzrlib.errors
179 import bzrlib.revision
180 import bzrlib.revisionspec
176 # Test the Breezy python lib
177 import breezy
178 import breezy.bzr.bzrdir
179 import breezy.errors
180 import breezy.revision
181 import breezy.revisionspec
181 182
182 bzrlib.revisionspec.RevisionSpec
183 return bzrlib.__doc__ is not None
183 breezy.revisionspec.RevisionSpec
184 if breezy.__doc__ is None or breezy.version_info[:2] < (3, 1):
185 return False
184 186 except (AttributeError, ImportError):
185 187 return False
186
187
188 @checkvers("bzr", "Canonical's Bazaar client >= %s", (1.14,))
189 def has_bzr_range(v):
190 major, minor = v.split('rc')[0].split('.')[0:2]
191 try:
192 import bzrlib
193
194 return bzrlib.__doc__ is not None and bzrlib.version_info[:2] >= (
195 int(major),
196 int(minor),
197 )
198 except ImportError:
199 return False
188 # Test the executable
189 return matchoutput('brz --version 2>&1', br'Breezy \(brz\) ')
200 190
201 191
202 192 @check("chg", "running with chg")
@@ -1,4 +1,4 b''
1 #require bzr bzr114
1 #require bzr
2 2
3 3 $ . "$TESTDIR/bzr-definitions"
4 4
@@ -9,18 +9,18 b' replace file with dir'
9 9
10 10 $ mkdir test-replace-file-with-dir
11 11 $ cd test-replace-file-with-dir
12 $ bzr init -q source
12 $ brz init -q source
13 13 $ cd source
14 14 $ echo d > d
15 $ bzr add -q d
16 $ bzr commit -q -m 'add d file'
15 $ brz add -q d
16 $ brz commit -q -m 'add d file'
17 17 $ rm d
18 18 $ mkdir d
19 $ bzr add -q d
20 $ bzr commit -q -m 'replace with d dir'
19 $ brz add -q d
20 $ brz commit -q -m 'replace with d dir'
21 21 $ echo a > d/a
22 $ bzr add -q d/a
23 $ bzr commit -q -m 'add d/a'
22 $ brz add -q d/a
23 $ brz commit -q -m 'add d/a'
24 24 $ cd ..
25 25 $ hg convert source source-hg
26 26 initializing destination source-hg repository
@@ -9,17 +9,17 b' empty directory'
9 9
10 10 $ mkdir test-empty
11 11 $ cd test-empty
12 $ bzr init -q source
12 $ brz init -q source
13 13 $ cd source
14 14 $ echo content > a
15 $ bzr add -q a
16 $ bzr commit -q -m 'Initial add'
15 $ brz add -q a
16 $ brz commit -q -m 'Initial add'
17 17 $ mkdir empty
18 $ bzr add -q empty
19 $ bzr commit -q -m 'Empty directory added'
18 $ brz add -q empty
19 $ brz commit -q -m 'Empty directory added'
20 20 $ echo content > empty/something
21 $ bzr add -q empty/something
22 $ bzr commit -q -m 'Added file into directory'
21 $ brz add -q empty/something
22 $ brz commit -q -m 'Added file into directory'
23 23 $ cd ..
24 24 $ hg convert source source-hg
25 25 initializing destination source-hg repository
@@ -42,15 +42,15 b' directory renames'
42 42
43 43 $ mkdir test-dir-rename
44 44 $ cd test-dir-rename
45 $ bzr init -q source
45 $ brz init -q source
46 46 $ cd source
47 47 $ mkdir tpyo
48 48 $ echo content > tpyo/something
49 $ bzr add -q tpyo
50 $ bzr commit -q -m 'Added directory'
51 $ bzr mv tpyo typo
49 $ brz add -q tpyo
50 $ brz commit -q -m 'Added directory'
51 $ brz mv tpyo typo
52 52 tpyo => typo
53 $ bzr commit -q -m 'Oops, typo'
53 $ brz commit -q -m 'Oops, typo'
54 54 $ cd ..
55 55 $ hg convert source source-hg
56 56 initializing destination source-hg repository
@@ -71,16 +71,16 b' nested directory renames'
71 71
72 72 $ mkdir test-nested-dir-rename
73 73 $ cd test-nested-dir-rename
74 $ bzr init -q source
74 $ brz init -q source
75 75 $ cd source
76 76 $ mkdir -p firstlevel/secondlevel/thirdlevel
77 77 $ echo content > firstlevel/secondlevel/file
78 78 $ echo this_needs_to_be_there_too > firstlevel/secondlevel/thirdlevel/stuff
79 $ bzr add -q firstlevel
80 $ bzr commit -q -m 'Added nested directories'
81 $ bzr mv firstlevel/secondlevel secondlevel
79 $ brz add -q firstlevel
80 $ brz commit -q -m 'Added nested directories'
81 $ brz mv firstlevel/secondlevel secondlevel
82 82 firstlevel/secondlevel => secondlevel
83 $ bzr commit -q -m 'Moved secondlevel one level up'
83 $ brz commit -q -m 'Moved secondlevel one level up'
84 84 $ cd ..
85 85 $ hg convert source source-hg
86 86 initializing destination source-hg repository
@@ -99,14 +99,14 b' directory remove'
99 99
100 100 $ mkdir test-dir-remove
101 101 $ cd test-dir-remove
102 $ bzr init -q source
102 $ brz init -q source
103 103 $ cd source
104 104 $ mkdir src
105 105 $ echo content > src/sourcecode
106 $ bzr add -q src
107 $ bzr commit -q -m 'Added directory'
108 $ bzr rm -q src
109 $ bzr commit -q -m 'Removed directory'
106 $ brz add -q src
107 $ brz commit -q -m 'Added directory'
108 $ brz rm -q src
109 $ brz commit -q -m 'Removed directory'
110 110 $ cd ..
111 111 $ hg convert source source-hg
112 112 initializing destination source-hg repository
@@ -126,19 +126,19 b' directory replace'
126 126
127 127 $ mkdir test-dir-replace
128 128 $ cd test-dir-replace
129 $ bzr init -q source
129 $ brz init -q source
130 130 $ cd source
131 131 $ mkdir first second
132 132 $ echo content > first/file
133 133 $ echo morecontent > first/dummy
134 134 $ echo othercontent > second/something
135 $ bzr add -q first second
136 $ bzr commit -q -m 'Initial layout'
137 $ bzr mv first/file second/file
135 $ brz add -q first second
136 $ brz commit -q -m 'Initial layout'
137 $ brz mv first/file second/file
138 138 first/file => second/file
139 $ bzr mv first third
139 $ brz mv first third
140 140 first => third
141 $ bzr commit -q -m 'Some conflicting moves'
141 $ brz commit -q -m 'Some conflicting moves'
142 142 $ cd ..
143 143 $ hg convert source source-hg
144 144 initializing destination source-hg repository
@@ -158,27 +158,27 b' divergent nested renames (issue3089)'
158 158
159 159 $ mkdir test-divergent-renames
160 160 $ cd test-divergent-renames
161 $ bzr init -q source
161 $ brz init -q source
162 162 $ cd source
163 163 $ mkdir -p a/c
164 164 $ echo a > a/fa
165 165 $ echo c > a/c/fc
166 $ bzr add -q a
167 $ bzr commit -q -m 'Initial layout'
168 $ bzr mv a b
166 $ brz add -q a
167 $ brz commit -q -m 'Initial layout'
168 $ brz mv a b
169 169 a => b
170 170 $ mkdir a
171 $ bzr add a
171 $ brz add a
172 172 add(ed|ing) a (re)
173 $ bzr mv b/c a/c
173 $ brz mv b/c a/c
174 174 b/c => a/c
175 $ bzr status
175 $ brz status
176 176 added:
177 177 a/
178 178 renamed:
179 179 a/? => b/? (re)
180 180 a/c/? => a/c/? (re)
181 $ bzr commit -q -m 'Divergent renames'
181 $ brz commit -q -m 'Divergent renames'
182 182 $ cd ..
183 183 $ hg convert source source-hg
184 184 initializing destination source-hg repository
@@ -3,11 +3,12 b''
3 3 $ . "$TESTDIR/bzr-definitions"
4 4 $ cat > ghostcreator.py <<EOF
5 5 > import sys
6 > from bzrlib import workingtree
6 > from breezy import workingtree
7 > import breezy.bzr.bzrdir
7 8 > wt = workingtree.WorkingTree.open('.')
8 9 >
9 10 > message, ghostrev = sys.argv[1:]
10 > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev])
11 > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev.encode()])
11 12 > wt.commit(message)
12 13 > EOF
13 14
@@ -15,11 +16,11 b' ghost revisions'
15 16
16 17 $ mkdir test-ghost-revisions
17 18 $ cd test-ghost-revisions
18 $ bzr init -q source
19 $ brz init -q source
19 20 $ cd source
20 21 $ echo content > somefile
21 $ bzr add -q somefile
22 $ bzr commit -q -m 'Initial layout setup'
22 $ brz add -q somefile
23 $ brz commit -q -m 'Initial layout setup'
23 24 $ echo morecontent >> somefile
24 25 $ "$PYTHON" ../../ghostcreator.py 'Commit with ghost revision' ghostrev
25 26 $ cd ..
@@ -10,37 +10,37 b' test multiple merges at once'
10 10
11 11 $ mkdir test-multimerge
12 12 $ cd test-multimerge
13 $ bzr init -q source
13 $ brz init -q source
14 14 $ cd source
15 15 $ echo content > file
16 16 $ echo text > rename_me
17 $ bzr add -q file rename_me
18 $ bzr commit -q -m 'Initial add' '--commit-time=2009-10-10 08:00:00 +0100'
17 $ brz add -q file rename_me
18 $ brz commit -q -m 'Initial add' '--commit-time=2009-10-10 08:00:00 +0100'
19 19 $ cd ..
20 $ bzr branch -q source source-branch1
20 $ brz branch -q source source-branch1
21 21 $ cd source-branch1
22 22 $ echo morecontent >> file
23 23 $ echo evenmorecontent > file-branch1
24 $ bzr add -q file-branch1
25 $ bzr commit -q -m 'Added branch1 file' '--commit-time=2009-10-10 08:00:01 +0100'
24 $ brz add -q file-branch1
25 $ brz commit -q -m 'Added branch1 file' '--commit-time=2009-10-10 08:00:01 +0100'
26 26 $ cd ../source
27 27 $ sleep 1
28 28 $ echo content > file-parent
29 $ bzr add -q file-parent
30 $ bzr commit -q -m 'Added parent file' '--commit-time=2009-10-10 08:00:02 +0100'
29 $ brz add -q file-parent
30 $ brz commit -q -m 'Added parent file' '--commit-time=2009-10-10 08:00:02 +0100'
31 31 $ cd ..
32 $ bzr branch -q source source-branch2
32 $ brz branch -q source source-branch2
33 33 $ cd source-branch2
34 34 $ echo somecontent > file-branch2
35 $ bzr add -q file-branch2
36 $ bzr mv -q rename_me renamed
35 $ brz add -q file-branch2
36 $ brz mv -q rename_me renamed
37 37 $ echo change > renamed
38 $ bzr commit -q -m 'Added brach2 file' '--commit-time=2009-10-10 08:00:03 +0100'
38 $ brz commit -q -m 'Added brach2 file' '--commit-time=2009-10-10 08:00:03 +0100'
39 39 $ sleep 1
40 40 $ cd ../source
41 $ bzr merge -q ../source-branch1
42 $ bzr merge -q --force ../source-branch2
43 $ bzr commit -q -m 'Merged branches' '--commit-time=2009-10-10 08:00:04 +0100'
41 $ brz merge -q ../source-branch1
42 $ brz merge -q --force ../source-branch2
43 $ brz commit -q -m 'Merged branches' '--commit-time=2009-10-10 08:00:04 +0100'
44 44 $ cd ..
45 45
46 46 BUG: file-branch2 should not be added in rev 4, and the rename_me -> renamed
@@ -3,11 +3,12 b''
3 3 $ . "$TESTDIR/bzr-definitions"
4 4 $ cat > treeset.py <<EOF
5 5 > import sys
6 > from bzrlib import workingtree
6 > from breezy import workingtree
7 > import breezy.bzr.bzrdir
7 8 > wt = workingtree.WorkingTree.open('.')
8 9 >
9 10 > message, rootid = sys.argv[1:]
10 > wt.set_root_id('tree_root-%s' % rootid)
11 > wt.set_root_id(b'tree_root-%s' % rootid.encode())
11 12 > wt.commit(message)
12 13 > EOF
13 14
@@ -15,11 +16,11 b' change the id of the tree root'
15 16
16 17 $ mkdir test-change-treeroot-id
17 18 $ cd test-change-treeroot-id
18 $ bzr init -q source
19 $ brz init -q source
19 20 $ cd source
20 21 $ echo content > file
21 $ bzr add -q file
22 $ bzr commit -q -m 'Initial add'
22 $ brz add -q file
23 $ brz commit -q -m 'Initial add'
23 24 $ "$PYTHON" ../../treeset.py 'Changed root' new
24 25 $ cd ..
25 26 $ hg convert source source-hg
@@ -6,7 +6,7 b' create and rename on the same file in th'
6 6
7 7 $ mkdir test-createandrename
8 8 $ cd test-createandrename
9 $ bzr init -q source
9 $ brz init -q source
10 10
11 11 test empty repo conversion (issue3233)
12 12
@@ -22,18 +22,18 b' back to the rename stuff'
22 22 $ echo a > a
23 23 $ echo c > c
24 24 $ echo e > e
25 $ bzr add -q a c e
26 $ bzr commit -q -m 'Initial add: a, c, e'
27 $ bzr mv a b
25 $ brz add -q a c e
26 $ brz commit -q -m 'Initial add: a, c, e'
27 $ brz mv a b
28 28 a => b
29 $ bzr mv c d
29 $ brz mv c d
30 30 c => d
31 $ bzr mv e f
31 $ brz mv e f
32 32 e => f
33 33 $ echo a2 >> a
34 34 $ mkdir e
35 $ bzr add -q a e
36 $ bzr commit -q -m 'rename a into b, create a, rename c into d'
35 $ brz add -q a e
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...
@@ -86,7 +86,7 b' test with filemap'
86 86
87 87 convert from lightweight checkout
88 88
89 $ bzr checkout --lightweight source source-light
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.
@@ -99,7 +99,7 b' yyyy-mm-dd HH:MM zzzz (no seconds!)'
99 99 compare timestamps
100 100
101 101 $ cd source
102 $ bzr log | \
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 ..
@@ -113,20 +113,21 b' merge'
113 113 $ cd test-merge
114 114 $ cat > helper.py <<EOF
115 115 > import sys
116 > from bzrlib import workingtree
116 > from breezy import workingtree
117 > import breezy.bzr.bzrdir
117 118 > wt = workingtree.WorkingTree.open('.')
118 119 >
119 120 > message, stamp = sys.argv[1:]
120 121 > wt.commit(message, timestamp=int(stamp))
121 122 > EOF
122 $ bzr init -q source
123 $ brz init -q source
123 124 $ cd source
124 125 $ echo content > a
125 126 $ echo content2 > b
126 $ bzr add -q a b
127 $ bzr commit -q -m 'Initial add'
127 $ brz add -q a b
128 $ brz commit -q -m 'Initial add'
128 129 $ cd ..
129 $ bzr branch -q source source-improve
130 $ brz branch -q source source-improve
130 131 $ cd source
131 132 $ echo more >> a
132 133 $ "$PYTHON" ../helper.py 'Editing a' 100
@@ -134,8 +135,8 b' merge'
134 135 $ echo content3 >> b
135 136 $ "$PYTHON" ../helper.py 'Editing b' 200
136 137 $ cd ../source
137 $ bzr merge -q ../source-improve
138 $ bzr commit -q -m 'Merged improve branch'
138 $ brz merge -q ../source-improve
139 $ brz commit -q -m 'Merged improve branch'
139 140 $ cd ..
140 141 $ hg convert --datesort source source-hg
141 142 initializing destination source-hg repository
@@ -163,7 +164,7 b' symlinks and executable files'
163 164
164 165 $ mkdir test-symlinks
165 166 $ cd test-symlinks
166 $ bzr init -q source
167 $ brz init -q source
167 168 $ cd source
168 169 $ touch program
169 170 $ chmod +x program
@@ -171,15 +172,15 b' symlinks and executable files'
171 172 $ mkdir d
172 173 $ echo a > d/a
173 174 $ ln -s a syma
174 $ bzr add -q altname program syma d/a
175 $ bzr commit -q -m 'Initial setup'
175 $ brz add -q altname program syma d/a
176 $ brz commit -q -m 'Initial setup'
176 177 $ touch newprog
177 178 $ chmod +x newprog
178 179 $ rm altname
179 180 $ ln -s newprog altname
180 181 $ chmod -x program
181 $ bzr add -q newprog
182 $ bzr commit -q -m 'Symlink changed, x bits changed'
182 $ brz add -q newprog
183 $ brz commit -q -m 'Symlink changed, x bits changed'
183 184 $ cd ..
184 185 $ hg convert source source-hg
185 186 initializing destination source-hg repository
@@ -215,30 +216,28 b' test the symlinks can be recreated'
215 216
216 217 Multiple branches
217 218
218 $ bzr init-repo -q --no-trees repo
219 $ bzr init -q repo/trunk
220 $ bzr co repo/trunk repo-trunk
219 $ brz init-repo -q --no-trees repo
220 $ brz init -q repo/trunk
221 $ brz co repo/trunk repo-trunk
221 222 $ cd repo-trunk
222 223 $ echo a > a
223 $ bzr add -q a
224 $ bzr ci -qm adda
225 $ bzr tag trunk-tag
224 $ brz add -q a
225 $ brz ci -qm adda
226 $ brz tag trunk-tag
226 227 Created tag trunk-tag.
227 $ bzr switch -b branch
228 $ brz switch -b branch
228 229 Tree is up to date at revision 1.
229 230 Switched to branch*repo/branch/ (glob)
230 $ sleep 1
231 231 $ echo b > b
232 $ bzr add -q b
233 $ bzr ci -qm addb
234 $ bzr tag branch-tag
232 $ brz add -q b
233 $ brz ci -qm addb
234 $ brz tag branch-tag
235 235 Created tag branch-tag.
236 $ bzr switch --force ../repo/trunk
236 $ brz switch --force ../repo/trunk
237 237 Updated to revision 1.
238 238 Switched to branch*/repo/trunk/ (glob)
239 $ sleep 1
240 239 $ echo a >> a
241 $ bzr ci -qm changea
240 $ brz ci -qm changea
242 241 $ cd ..
243 242 $ hg convert --datesort repo repo-bzr
244 243 initializing destination repo-bzr repository
@@ -269,13 +268,13 b' not and get incorporated in extra fields'
269 268
270 269 Nested repositories (issue3254)
271 270
272 $ bzr init-repo -q --no-trees repo/inner
273 $ bzr init -q repo/inner/trunk
274 $ bzr co repo/inner/trunk inner-trunk
271 $ brz init-repo -q --no-trees repo/inner
272 $ brz init -q repo/inner/trunk
273 $ brz co repo/inner/trunk inner-trunk
275 274 $ cd inner-trunk
276 275 $ echo b > b
277 $ bzr add -q b
278 $ bzr ci -qm addb
276 $ brz add -q b
277 $ brz ci -qm addb
279 278 $ cd ..
280 279 $ hg convert --datesort repo noinner-bzr
281 280 initializing destination noinner-bzr repository
General Comments 0
You need to be logged in to leave comments. Login now