346
346
zf = ZipFile('../first-zip')
347
347
self.assert_('first-zip/hello' in zf.namelist(), zf.namelist())
350
self.example_branch()
351
file('hello', 'wt').write('hello world!')
352
self.runbzr('commit -m fixing hello')
353
output = self.runbzr('diff -r 2..3', backtick=1, retcode=1)
354
self.assert_('\n+hello world!' in output)
355
output = self.runbzr('diff -r last:3..last:1', backtick=1, retcode=1)
356
self.assert_('\n+baz' in output)
357
file('moo', 'wb').write('moo')
358
self.runbzr('add moo')
362
def test_diff_branches(self):
363
self.build_tree(['branch1/', 'branch1/file', 'branch2/'], line_endings='binary')
364
branch = Branch.initialize('branch1')
365
branch.working_tree().add(['file'])
366
branch.working_tree().commit('add file')
367
copy_branch(branch, 'branch2')
368
print >> open('branch2/file', 'wb'), 'new content'
369
branch2 = Branch.open('branch2')
370
branch2.working_tree().commit('update file')
371
# should open branch1 and diff against branch2,
372
output = self.run_bzr_captured(['diff', '-r', 'branch:branch2',
375
self.assertEquals(("=== modified file 'file'\n"
380
"+contents of branch1/file\n"
382
output = self.run_bzr_captured(['diff', 'branch2', 'branch1'],
384
self.assertEqualDiff(("=== modified file 'file'\n"
389
"+contents of branch1/file\n"
393
349
def test_branch(self):
394
350
"""Branch from one branch to another."""