/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: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

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
 
 
22
21
def write_inventory(writer, inventory):
23
22
    s = Stanza(inventory_version=7)
24
23
    writer.write_stanza(s)
33
32
            attr_val = getattr(ie, attr, None)
34
33
            if attr == 'executable' and attr_val == 0:
35
34
                continue
36
 
            if attr == 'parent_id' and attr_val == b'TREE_ROOT':
 
35
            if attr == 'parent_id' and attr_val == 'TREE_ROOT':
37
36
                continue
38
37
            if attr_val is not None:
39
38
                s.add(attr, attr_val)
42
41
 
43
42
def read_inventory(inv_file):
44
43
    """Read inventory object from rio formatted inventory file"""
45
 
    from breezy.bzr.inventory import Inventory, InventoryFile
 
44
    from bzrlib.inventory import Inventory, InventoryFile
46
45
    s = read_stanza(inv_file)
47
46
    assert s['inventory_version'] == 7
48
47
    inv = Inventory()