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

  • Committer: Jelmer Vernooij
  • Date: 2017-07-24 01:07:36 UTC
  • mfrom: (6734.1.7 move-errors-views)
  • Revision ID: jelmer@jelmer.uk-20170724010736-7a67j6n1t2nz914n
Merge lp:~jelmer/bzr/move-errors-views.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from . import errors
26
26
 
27
27
 
 
28
class AlreadyBuilding(errors.BzrError):
 
29
 
 
30
    _fmt = "The tree builder is already building a tree."
 
31
 
 
32
 
 
33
class NotBuilding(errors.BzrError):
 
34
 
 
35
    _fmt = "Not currently building a tree."
 
36
 
 
37
 
28
38
class TreeBuilder(object):
29
39
    """A TreeBuilder allows the creation of specific content in one tree at a
30
40
    time.
59
69
    def _ensure_building(self):
60
70
        """Raise NotBuilding if there is no current tree being built."""
61
71
        if self._tree is None:
62
 
            raise errors.NotBuilding
 
72
            raise NotBuilding
63
73
 
64
74
    def finish_tree(self):
65
75
        """Finish building the current tree."""
75
85
            MutableTree interface.
76
86
        """
77
87
        if self._tree is not None:
78
 
            raise errors.AlreadyBuilding
 
88
            raise AlreadyBuilding
79
89
        self._tree = tree
80
90
        self._tree.lock_tree_write()