~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_too_much.py

MergeĀ fromĀ jam-integration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
346
346
        zf = ZipFile('../first-zip')
347
347
        self.assert_('first-zip/hello' in zf.namelist(), zf.namelist())
348
348
 
349
 
    def test_diff(self):
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')
359
 
        os.unlink('moo')
360
 
        self.runbzr('diff')
361
 
 
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', 
373
 
                                        'branch1'],
374
 
                                       retcode=1)
375
 
        self.assertEquals(("=== modified file 'file'\n"
376
 
                           "--- file\t\n"
377
 
                           "+++ file\t\n"
378
 
                           "@@ -1,1 +1,1 @@\n"
379
 
                           "-new content\n"
380
 
                           "+contents of branch1/file\n"
381
 
                           "\n", ''), output)
382
 
        output = self.run_bzr_captured(['diff', 'branch2', 'branch1'],
383
 
                                       retcode=1)
384
 
        self.assertEqualDiff(("=== modified file 'file'\n"
385
 
                              "--- file\t\n"
386
 
                              "+++ file\t\n"
387
 
                              "@@ -1,1 +1,1 @@\n"
388
 
                              "-new content\n"
389
 
                              "+contents of branch1/file\n"
390
 
                              "\n", ''), output)
391
 
 
392
 
 
393
349
    def test_branch(self):
394
350
        """Branch from one branch to another."""
395
351
        os.mkdir('a')