276
276
zf = ZipFile('../first-zip')
277
277
self.assert_('first-zip/hello' in zf.namelist(), zf.namelist())
279
def test_branch(self):
280
"""Branch from one branch to another."""
283
self.example_branch()
285
self.runbzr('branch a b')
286
b = bzrlib.branch.Branch.open('b')
287
self.assertEqual('b\n', b.control_files.get_utf8('branch-name').read())
288
self.runbzr('branch a c -r 1')
290
self.runbzr('commit -m foo --unchanged')
293
def test_branch_basis(self):
294
# ensure that basis really does grab from the basis by having incomplete source
295
tree = self.make_branch_and_tree('commit_tree')
296
self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
298
tree.commit('revision 1', rev_id='1')
299
source = self.make_branch_and_tree('source')
300
# this gives us an incomplete repository
301
tree.bzrdir.open_repository().copy_content_into(source.branch.repository)
302
tree.commit('revision 2', rev_id='2', allow_pointless=True)
303
tree.bzrdir.open_branch().copy_content_into(source.branch)
304
tree.copy_content_into(source)
305
self.assertFalse(source.branch.repository.has_revision('2'))
307
self.runbzr('branch source target --basis commit_tree')
308
target = bzrdir.BzrDir.open('target')
309
self.assertEqual('2', target.open_branch().last_revision())
310
self.assertEqual('2', target.open_workingtree().last_revision())
311
self.assertTrue(target.open_branch().repository.has_revision('2'))
313
279
def test_inventory(self):
314
280
bzr = self.runbzr
315
281
def output_equals(value, *args):