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

Avoid Inventory.copy, which has disappeared in newer versions of Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
_serializer_handles_escaping = hasattr(serializer.Serializer,
45
45
    'squashes_xml_invalid_characters')
46
46
 
 
47
 
47
48
def copy_inventory(inv):
48
 
    # This currently breaks revision-id matching
49
 
    #if hasattr(inv, "_get_mutable_inventory"):
50
 
    #    # TODO: Make this a public API on inventory
51
 
    #    return inv._get_mutable_inventory()
52
 
 
53
 
    # TODO: Shallow copy - deep inventory copying is expensive
54
 
    return inv.copy()
 
49
    entries = inv.iter_entries_by_dir()
 
50
    inv = inventory.Inventory(None, inventory.revision_id)
 
51
    for path, inv_entry in entries:
 
52
        inv.add(inv_entry.copy())
 
53
    return inv
55
54
 
56
55
 
57
56
class GenericCommitHandler(processor.CommitHandler):