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

  • Committer: Robert Collins
  • Date: 2009-03-16 03:34:05 UTC
  • mto: This revision was merged to the branch mainline in revision 4149.
  • Revision ID: robertc@robertcollins.net-20090316033405-wpq3do6shludp1bh
Explicitly prevent fetching while the target repository is in a write group.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        repo.fetch(tree_a.branch.repository,
46
46
                   revision_id=None)
47
47
 
 
48
    def test_fetch_fails_in_write_group(self):
 
49
        # fetch() manages a write group itself, fetching within one isn't safe.
 
50
        repo = self.make_repository('a')
 
51
        repo.lock_write()
 
52
        self.addCleanup(repo.unlock)
 
53
        repo.start_write_group()
 
54
        self.addCleanup(repo.abort_write_group)
 
55
        # Don't need a specific class - not expecting flow control based on
 
56
        # this.
 
57
        self.assertRaises(errors.BzrError, repo.fetch, repo)
 
58
 
48
59
    def test_fetch_to_knit3(self):
49
60
        # create a repository of the sort we are testing.
50
61
        tree_a = self.make_branch_and_tree('a')