/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/per_repository_vf/test_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-04 19:06:44 UTC
  • mfrom: (5816.4.2 move-more-repo-vf-tests)
  • Revision ID: pqm@pqm.ubuntu.com-20110504190644-xt0ebtkasp1rnfkc
(jelmer) Move more tests that require the full versioned files API to
 bzrlib.tests.per_repository_vf. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from bzrlib import (
20
20
    errors,
 
21
    gpg,
 
22
    repository as _mod_repository,
21
23
    tests,
22
24
    versionedfile,
23
25
    )
112
114
        self.assertRaises(errors.ObjectNotLocked,
113
115
            inventories.add_lines, ('foo',), [], [])
114
116
 
 
117
    def test_install_revisions(self):
 
118
        wt = self.make_branch_and_tree('source')
 
119
        wt.commit('A', allow_pointless=True, rev_id='A')
 
120
        repo = wt.branch.repository
 
121
        repo.lock_write()
 
122
        repo.start_write_group()
 
123
        repo.sign_revision('A', gpg.LoopbackGPGStrategy(None))
 
124
        repo.commit_write_group()
 
125
        repo.unlock()
 
126
        repo.lock_read()
 
127
        self.addCleanup(repo.unlock)
 
128
        repo2 = self.make_repository('repo2')
 
129
        revision = repo.get_revision('A')
 
130
        tree = repo.revision_tree('A')
 
131
        signature = repo.get_signature_text('A')
 
132
        repo2.lock_write()
 
133
        self.addCleanup(repo2.unlock)
 
134
        _mod_repository.install_revisions(repo2, [(revision, tree, signature)])
 
135
        self.assertEqual(revision, repo2.get_revision('A'))
 
136
        self.assertEqual(signature, repo2.get_signature_text('A'))
 
137
 
115
138
 
116
139
class TestCaseWithComplexRepository(TestCaseWithRepository):
117
140