/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 tools/riodemo.py

  • Committer: Jelmer Vernooij
  • Date: 2020-04-05 19:11:34 UTC
  • mto: (7490.7.16 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200405191134-0aebh8ikiwygxma5
Populate the .gitignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
 
4
4
# \subsection{Example usage}
5
 
6
 
# \textbf{XXX:} Move these to object serialization code. 
 
5
#
 
6
# \textbf{XXX:} Move these to object serialization code.
7
7
 
8
8
def write_revision(writer, revision):
9
9
    s = Stanza(revision=revision.revision_id,
10
 
               committer=revision.committer, 
 
10
               committer=revision.committer,
11
11
               timezone=long(revision.timezone),
12
12
               timestamp=long(revision.timestamp),
13
13
               inventory_sha1=revision.inventory_sha1,
18
18
        s.add(prop_name, prop_value)
19
19
    writer.write_stanza(s)
20
20
 
 
21
 
21
22
def write_inventory(writer, inventory):
22
23
    s = Stanza(inventory_version=7)
23
24
    writer.write_stanza(s)
32
33
            attr_val = getattr(ie, attr, None)
33
34
            if attr == 'executable' and attr_val == 0:
34
35
                continue
35
 
            if attr == 'parent_id' and attr_val == 'TREE_ROOT':
 
36
            if attr == 'parent_id' and attr_val == b'TREE_ROOT':
36
37
                continue
37
38
            if attr_val is not None:
38
39
                s.add(attr, attr_val)
41
42
 
42
43
def read_inventory(inv_file):
43
44
    """Read inventory object from rio formatted inventory file"""
44
 
    from bzrlib.inventory import Inventory, InventoryFile
 
45
    from breezy.bzr.inventory import Inventory, InventoryFile
45
46
    s = read_stanza(inv_file)
46
47
    assert s['inventory_version'] == 7
47
48
    inv = Inventory()