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

Merge bzr.dev 4032. Resolve the new streaming fetch.

XXX: We cheat a bit for CHK fetching. CHK serializers happen to still
have legacy 'read_inventory_from_string' and 'write_inventory_to_string'
functions that convert the paged representation to a single-string XML
representation.

So when converting between formats, we just go down to the
whole-inventory XML form.

At least it works for now. Even if it is grossly innefficient.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
from bzrlib import versionedfile
48
48
""")
49
49
from bzrlib import (
 
50
    errors,
50
51
    lru_cache,
51
52
    osutils,
52
53
    registry,
1303
1304
            # TODO: Handle 'absent'
1304
1305
            if pb is not None:
1305
1306
                pb.tick()
1306
 
            if record.storage_kind in ('fulltext', 'chunked'):
 
1307
            try:
1307
1308
                bytes = record.get_bytes_as('fulltext')
1308
 
            else:
1309
 
                bytes = adapter.get_bytes(record,
1310
 
                            record.get_bytes_as(record.storage_kind))
 
1309
            except errors.UnavailableRepresentation:
 
1310
                bytes = adapter.get_bytes(record)
1311
1311
            # We don't care about search_key_func for this code, because we
1312
1312
            # only care about external references.
1313
1313
            node = _deserialise(bytes, record.key, search_key_func=None)
1375
1375
            if pb is not None:
1376
1376
                pb.update('find chk pages', counter)
1377
1377
            # TODO: Handle 'absent'?
1378
 
            if record.storage_kind in ('fulltext', 'chunked'):
 
1378
            try:
1379
1379
                bytes = record.get_bytes_as('fulltext')
1380
 
            else:
1381
 
                bytes = adapter.get_bytes(record,
1382
 
                            record.get_bytes_as(record.storage_kind))
 
1380
            except errors.UnavailableRepresentation:
 
1381
                bytes = adapter.get_bytes(record)
1383
1382
            # We don't care about search_key_func for this code, because we
1384
1383
            # only care about external references.
1385
1384
            node = _deserialise(bytes, record.key, search_key_func=None)