103
103
self.runbzr("--pants off", retcode=3)
104
104
self.runbzr("diff --message foo", retcode=3)
106
def test_remove_deleted(self):
108
self.build_tree(['a'])
109
self.runbzr(['add', 'a'])
110
self.runbzr(['commit', '-m', 'added a'])
112
self.runbzr(['remove', 'a'])
114
106
def test_ignore_patterns(self):
115
107
self.runbzr('init')
116
108
self.assertEquals(self.capture('unknowns'), '')
276
268
zf = ZipFile('../first-zip')
277
269
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
271
def test_inventory(self):
314
272
bzr = self.runbzr
315
273
def output_equals(value, *args):
865
823
max_width = terminal_width() - 1
866
824
for line in log_out.splitlines():
867
825
self.assert_(len(line) <= max_width, len(line))
868
self.assert_("this is my new commit and" in log_out)
826
self.assert_("this is my new commit and" not in log_out)
827
self.assert_("this is my new commit" in log_out)
870
829
progress("file with spaces in name")
871
830
mkdir('sub directory')