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

  • Committer: Robert Collins
  • Date: 2010-05-05 00:05:29 UTC
  • mto: This revision was merged to the branch mainline in revision 5206.
  • Revision ID: robertc@robertcollins.net-20100505000529-ltmllyms5watqj5u
Make 'pydoc bzrlib.tests.build_tree_shape' useful.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
17
 
19
 
from .errors import BzrError
20
 
from .inventory import Inventory
 
18
from bzrlib.errors import BzrError
 
19
from bzrlib.inventory import Inventory
21
20
 
22
21
 
23
22
START_MARK = "# bzr inventory format 3\n"
35
34
            .replace('\n', r'\x0a'))
36
35
 
37
36
 
 
37
 
38
38
def unescape(s):
39
39
    if s.find(' ') != -1:
40
40
        raise AssertionError()
48
48
    return s
49
49
 
50
50
 
 
51
 
 
52
 
51
53
def write_text_inventory(inv, outf):
52
54
    """Write out inv in a simple trad-unix text format."""
53
55
    outf.write(START_MARK)
83
85
              'name': unescape(fields[1]),
84
86
              'kind': fields[2],
85
87
              'parent_id': fields[3]}
86
 
        # inv.add(ie)
 
88
        ##inv.add(ie)
87
89
 
88
90
    if l != END_MARK:
89
91
        raise BzrError("missing end mark")