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

  • Committer: Martin Pool
  • Date: 2008-05-27 08:12:28 UTC
  • mfrom: (3453 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3455.
  • Revision ID: mbp@sourcefrog.net-20080527081228-2ft0nnz7edsz1jfa
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
        finally:
94
94
            to_repo.unlock()
95
95
 
96
 
        # Implementations can either copy the missing basis text, or raise an
97
 
        # exception
 
96
        # Implementations can either ensure that the target of the delta is
 
97
        # reconstructable, or raise an exception (which stream based copies
 
98
        # generally do).
98
99
        try:
99
100
            to_repo.fetch(tree.branch.repository, 'rev-two')
100
101
        except errors.RevisionNotPresent, e:
101
102
            # If an exception is raised, the revision should not be in the
102
103
            # target.
103
 
            self.assertRaises(
104
 
                (errors.NoSuchRevision, errors.RevisionNotPresent),
105
 
                 to_repo.revision_tree, 'rev-two')
 
104
            self.assertRaises((errors.NoSuchRevision, errors.RevisionNotPresent),
 
105
                              to_repo.revision_tree, 'rev-two')
106
106
        else:
107
 
            # If not exception is raised, then the basis text should be
 
107
            # If not exception is raised, then the text should be
108
108
            # available.
109
109
            to_repo.lock_read()
110
110
            try:
111
 
                rt = to_repo.revision_tree('rev-one')
112
 
                self.assertEqual('contents of tree/a\n',
 
111
                rt = to_repo.revision_tree('rev-two')
 
112
                self.assertEqual('new contents\n',
113
113
                                 rt.get_file_text('a-id'))
114
114
            finally:
115
115
                to_repo.unlock()
118
118
        repo_a = self.make_repository('.')
119
119
        repo_b = repository.Repository.open('.')
120
120
        try:
121
 
            self.assertRaises(errors.NoSuchRevision, repo_b.fetch, repo_a,
122
 
                              revision_id='XXX')
 
121
            self.assertRaises(errors.NoSuchRevision, repo_b.fetch, repo_a, revision_id='XXX')
123
122
        except errors.LockError, e:
124
123
            check_old_format_lock_error(self.repository_format)
125
124
 
173
172
        from_tree.add('filename', 'funky-chars<>%&;"\'')
174
173
        from_tree.commit('commit filename')
175
174
        to_repo = self.make_to_repository('to')
176
 
        to_repo.fetch(from_tree.branch.repository,
177
 
                      from_tree.get_parent_ids()[0])
 
175
        to_repo.fetch(from_tree.branch.repository, from_tree.get_parent_ids()[0])
178
176
 
179
177
    def test_fetch_revision_hash(self):
180
178
        """Ensure that inventory hashes are updated by fetch"""