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

  • Committer: Aaron Bentley
  • Date: 2006-11-17 04:06:03 UTC
  • mfrom: (2139 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2162.
  • Revision ID: aaron.bentley@utoronto.ca-20061117040603-pgebxndswvwk26tt
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    def __init__(self):
32
32
        """Construct a TreeBuilder."""
33
33
        self._tree = None
 
34
        self._root_done = False
34
35
 
35
36
    def build(self, recipe):
36
37
        """Build recipe into the current tree.
40
41
            '/' then a directory is added, otherwise a regular file is added.
41
42
        """
42
43
        self._ensure_building()
 
44
        if not self._root_done:
 
45
            self._tree.add('', 'root-id', 'directory')
 
46
            self._root_done = True
43
47
        for name in recipe:
44
48
            assert isinstance(name, basestring)
45
49
            if name[-1] == '/':
73
77
            raise errors.AlreadyBuilding
74
78
        self._tree = tree
75
79
        self._tree.lock_tree_write()
76