/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: Aaron Bentley
  • Date: 2007-11-18 18:43:35 UTC
  • mfrom: (3006 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3011.
  • Revision ID: aaron.bentley@utoronto.ca-20071118184335-rjptgedxv4357lna
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    bzrdir,
21
21
    errors,
22
22
    gpg,
 
23
    repository,
23
24
    )
24
25
from bzrlib.tests import TestSkipped
25
26
from bzrlib.tests.repository_implementations import TestCaseWithRepository
81
82
        rev2_tree = knit3_repo.revision_tree('rev2')
82
83
        self.assertEqual('rev1', rev2_tree.inventory.root.revision)
83
84
 
 
85
    def test_fetch_all_from_self(self):
 
86
        tree = self.make_branch_and_tree('.')
 
87
        rev_id = tree.commit('one')
 
88
        # This needs to be a new copy of the repository, if this changes, the
 
89
        # test needs to be rewritten
 
90
        repo = tree.branch.repository.bzrdir.open_repository()
 
91
        # This fetch should be a no-op see bug #158333
 
92
        tree.branch.repository.fetch(repo, None)
 
93
 
 
94
    def test_fetch_from_self(self):
 
95
        tree = self.make_branch_and_tree('.')
 
96
        rev_id = tree.commit('one')
 
97
        repo = tree.branch.repository.bzrdir.open_repository()
 
98
        # This fetch should be a no-op see bug #158333
 
99
        tree.branch.repository.fetch(repo, rev_id)
 
100
 
 
101
    def test_fetch_missing_from_self(self):
 
102
        tree = self.make_branch_and_tree('.')
 
103
        rev_id = tree.commit('one')
 
104
        # Even though the fetch() is a NO-OP it should assert the revision id
 
105
        # is present
 
106
        repo = tree.branch.repository.bzrdir.open_repository()
 
107
        self.assertRaises(errors.NoSuchRevision, tree.branch.repository.fetch,
 
108
                          repo, 'no-such-revision')
 
109
 
84
110
    def makeARepoWithSignatures(self):
85
111
        wt = self.make_branch_and_tree('a-repo-with-sigs')
86
112
        wt.commit('rev1', allow_pointless=True, rev_id='rev1')