/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

First attempt to merge .dev and resolve the conflicts (but tests are 
failing)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
36
36
 
37
37
 
38
38
def unescape(s):
39
 
    assert s.find(' ') == -1
 
39
    if s.find(' ') != -1:
 
40
        raise AssertionError()
40
41
    s = (s.replace(r'\x20', ' ')
41
42
         .replace(r'\x09', '\t')
42
43
         .replace(r'\x0a', '\n')
52
53
def write_text_inventory(inv, outf):
53
54
    """Write out inv in a simple trad-unix text format."""
54
55
    outf.write(START_MARK)
55
 
    entries = inv.iter_entries()
56
 
    entries.next()
57
 
    for path, ie in entries:
 
56
    for path, ie in inv.iter_entries():
 
57
        if inv.is_root(ie.file_id):
 
58
            continue
 
59
        
58
60
        outf.write(ie.file_id + ' ')
59
61
        outf.write(escape(ie.name) + ' ')
60
62
        outf.write(ie.kind + ' ')