/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: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
can be extremely useful in testing for instance.
21
21
"""
22
22
 
 
23
from __future__ import absolute_import
 
24
 
23
25
from . import errors
24
26
 
25
27
 
52
54
        """
53
55
        self._ensure_building()
54
56
        if not self._root_done:
55
 
            self._tree.add('', b'root-id', 'directory')
 
57
            self._tree.add('', 'root-id', 'directory')
56
58
            self._root_done = True
57
59
        for name in recipe:
58
 
            if name.endswith('/'):
 
60
            if name[-1] == '/':
59
61
                self._tree.mkdir(name[:-1])
60
62
            else:
61
 
                end = b'\n'
62
 
                content = b"contents of %s%s" % (name.encode('utf-8'), end)
 
63
                end = '\n'
 
64
                content = "contents of %s%s" % (name.encode('utf-8'), end)
63
65
                self._tree.add(name, None, 'file')
64
66
                self._tree.put_file_bytes_non_atomic(name, content)
65
67