/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_branch.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import bzrlib.bzrdir as bzrdir
24
24
from bzrlib.branch import Branch, needs_read_lock, needs_write_lock
25
25
from bzrlib.commit import commit
 
26
from bzrlib.delta import TreeDelta
26
27
import bzrlib.errors as errors
27
28
from bzrlib.errors import (FileExists,
28
29
                           NoSuchRevision,
101
102
        tree = b2.repository.revision_tree('revision-1')
102
103
        self.assertEqual(tree.get_file_text('foo-id'), 'hello')
103
104
 
 
105
    def test_get_revision_delta(self):
 
106
        tree_a = self.make_branch_and_tree('a')
 
107
        self.build_tree(['a/foo'])
 
108
        tree_a.add('foo', 'file1')
 
109
        tree_a.commit('rev1', rev_id='rev1')
 
110
        self.build_tree(['a/vla'])
 
111
        tree_a.add('vla', 'file2')
 
112
        tree_a.commit('rev2', rev_id='rev2')
 
113
 
 
114
        delta = tree_a.branch.get_revision_delta(1)
 
115
        self.assertIsInstance(delta, TreeDelta)
 
116
        self.assertEqual([('foo', 'file1', 'file')], delta.added)
 
117
        delta = tree_a.branch.get_revision_delta(2)
 
118
        self.assertIsInstance(delta, TreeDelta)
 
119
        self.assertEqual([('vla', 'file2', 'file')], delta.added)
 
120
 
104
121
    def get_unbalanced_tree_pair(self):
105
122
        """Return two branches, a and b, with one file in a."""
106
123
        get_transport(self.get_url()).mkdir('a')
490
507
        self.assertEqual(None, self.get_branch().get_push_location())
491
508
 
492
509
    def test_get_push_location_exact(self):
493
 
        from bzrlib.config import (branches_config_filename,
 
510
        from bzrlib.config import (locations_config_filename,
494
511
                                   ensure_config_dir_exists)
495
512
        ensure_config_dir_exists()
496
 
        fn = branches_config_filename()
 
513
        fn = locations_config_filename()
497
514
        print >> open(fn, 'wt'), ("[%s]\n"
498
515
                                  "push_location=foo" %
499
516
                                  self.get_branch().base[:-1])
500
517
        self.assertEqual("foo", self.get_branch().get_push_location())
501
518
 
502
519
    def test_set_push_location(self):
503
 
        from bzrlib.config import (branches_config_filename,
 
520
        from bzrlib.config import (locations_config_filename,
504
521
                                   ensure_config_dir_exists)
505
522
        ensure_config_dir_exists()
506
 
        fn = branches_config_filename()
 
523
        fn = locations_config_filename()
507
524
        self.get_branch().set_push_location('foo')
508
525
        self.assertFileEqual("[%s]\n"
509
526
                             "push_location = foo" % self.get_branch().base[:-1],