/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 breezy/tests/per_repository_vf/test_check_reconcile.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-07 22:31:36 UTC
  • mto: This revision was merged to the branch mainline in revision 7306.
  • Revision ID: jelmer@jelmer.uk-20181107223136-2uss9siifwvsq2ha
Add WriteGroup contextmanager.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    Inventory,
26
26
    InventoryFile,
27
27
    )
 
28
from breezy.repository import WriteGroup
28
29
from breezy.revision import (
29
30
    NULL_REVISION,
30
31
    Revision,
793
794
    def make_populated_repository(self, factory):
794
795
        """Create a new repository populated by the given factory."""
795
796
        repo = self.make_repository('broken-repo')
796
 
        with repo.lock_write():
797
 
            repo.start_write_group()
798
 
            try:
799
 
                factory(repo)
800
 
                repo.commit_write_group()
801
 
                return repo
802
 
            except:
803
 
                repo.abort_write_group()
804
 
                raise
 
797
        with repo.lock_write(), WriteGroup(repo):
 
798
            factory(repo)
 
799
            return repo
805
800
 
806
801
    def add_revision(self, repo, revision_id, inv, parent_ids):
807
802
        """Add a revision with a given inventory and parents to a repository.