/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/repository_implementations/test_fetch.py

  • Committer: Andrew Bennetts
  • Date: 2008-09-08 12:59:00 UTC
  • mfrom: (3695 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080908125900-8ywtsr7jqyyatjz0
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
    def test_fetch_knit3(self):
50
50
        # create a repository of the sort we are testing.
51
 
        tree_a = self.make_branch_and_tree('a', '')
 
51
        tree_a = self.make_branch_and_tree('a')
52
52
        self.build_tree(['a/foo'])
53
53
        tree_a.add('foo', 'file1')
54
54
        tree_a.commit('rev1', rev_id='rev1')
69
69
        # disk.
70
70
        knit3_repo = b_bzrdir.open_repository()
71
71
        rev1_tree = knit3_repo.revision_tree('rev1')
72
 
        lines = rev1_tree.get_file_lines(rev1_tree.get_root_id())
 
72
        rev1_tree.lock_read()
 
73
        try:
 
74
            lines = rev1_tree.get_file_lines(rev1_tree.get_root_id())
 
75
        finally:
 
76
            rev1_tree.unlock()
73
77
        self.assertEqual([], lines)
74
78
        b_branch = b_bzrdir.create_branch()
75
79
        b_branch.pull(tree_a.branch)
127
131
            target_repo.get_signature_text('rev1'))
128
132
 
129
133
    def make_repository_with_one_revision(self):
130
 
        wt = self.make_branch_and_tree('source', '')
 
134
        wt = self.make_branch_and_tree('source')
131
135
        wt.commit('rev1', allow_pointless=True, rev_id='rev1')
132
136
        return wt.branch.repository
133
137
 
141
145
        # without causing any errors.
142
146
        target_repo.fetch(source_repo, revision_id='rev1')
143
147
 
 
148
    def test_fetch_all_same_revisions_twice(self):
 
149
        # Blind-fetching all the same revisions twice should succeed and be a
 
150
        # no-op the second time.
 
151
        repo = self.make_repository('repo')
 
152
        tree = self.make_branch_and_tree('tree')
 
153
        revision_id = tree.commit('test')
 
154
        repo.fetch(tree.branch.repository)
 
155
        repo.fetch(tree.branch.repository)