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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-01-01 21:23:40 UTC
  • mfrom: (7206.4.1 move-testament)
  • Revision ID: breezy.the.bot@gmail.com-20190101212340-6wmbncvwqal06rif
Move the testament module to breezy.bzr.

Merged from https://code.launchpad.net/~jelmer/brz/move-testament/+merge/359939

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
17
18
 
18
 
from bzrlib.errors import BzrError
19
 
from bzrlib.inventory import Inventory
 
19
from .errors import BzrError
 
20
from .inventory import Inventory
20
21
 
21
22
 
22
23
START_MARK = "# bzr inventory format 3\n"
34
35
            .replace('\n', r'\x0a'))
35
36
 
36
37
 
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
 
 
53
51
def write_text_inventory(inv, outf):
54
52
    """Write out inv in a simple trad-unix text format."""
55
53
    outf.write(START_MARK)
85
83
              'name': unescape(fields[1]),
86
84
              'kind': fields[2],
87
85
              'parent_id': fields[3]}
88
 
        ##inv.add(ie)
 
86
        # inv.add(ie)
89
87
 
90
88
    if l != END_MARK:
91
89
        raise BzrError("missing end mark")