~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-04 16:06:36 UTC
  • mfrom: (5007 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100204160636-xqeuwz8bwt8bbts4
Merge bzr.dev 5007, resolve conflict, update NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1240
1240
        """Check a single text from this repository."""
1241
1241
        if kind == 'inventories':
1242
1242
            rev_id = record.key[0]
1243
 
            inv = self.deserialise_inventory(rev_id,
 
1243
            inv = self._deserialise_inventory(rev_id,
1244
1244
                record.get_bytes_as('fulltext'))
1245
1245
            if last_object is not None:
1246
1246
                delta = inv._make_delta(last_object)
2388
2388
        """single-document based inventory iteration."""
2389
2389
        inv_xmls = self._iter_inventory_xmls(revision_ids, ordering)
2390
2390
        for text, revision_id in inv_xmls:
2391
 
            yield self.deserialise_inventory(revision_id, text)
 
2391
            yield self._deserialise_inventory(revision_id, text)
2392
2392
 
2393
2393
    def _iter_inventory_xmls(self, revision_ids, ordering):
2394
2394
        if ordering is None:
2426
2426
                        next_key = None
2427
2427
                        break
2428
2428
 
2429
 
    def deserialise_inventory(self, revision_id, xml):
 
2429
    def _deserialise_inventory(self, revision_id, xml):
2430
2430
        """Transform the xml into an inventory object.
2431
2431
 
2432
2432
        :param revision_id: The expected revision id of the inventory.
2440
2440
                result.revision_id, revision_id))
2441
2441
        return result
2442
2442
 
2443
 
    def serialise_inventory(self, inv):
 
2443
    def _serialise_inventory(self, inv):
2444
2444
        return self._serializer.write_inventory_to_string(inv)
2445
2445
 
2446
2446
    def _serialise_inventory_to_lines(self, inv):
2450
2450
        return self._serializer.format_num
2451
2451
 
2452
2452
    @needs_read_lock
2453
 
    def get_inventory_xml(self, revision_id):
2454
 
        """Get inventory XML as a file object."""
 
2453
    def _get_inventory_xml(self, revision_id):
 
2454
        """Get serialized inventory as a string."""
2455
2455
        texts = self._iter_inventory_xmls([revision_id], 'unordered')
2456
2456
        try:
2457
2457
            text, revision_id = texts.next()
2459
2459
            raise errors.HistoryMissing(self, 'inventory', revision_id)
2460
2460
        return text
2461
2461
 
2462
 
    @needs_read_lock
2463
 
    def get_inventory_sha1(self, revision_id):
2464
 
        """Return the sha1 hash of the inventory entry
2465
 
        """
2466
 
        return self.get_revision(revision_id).inventory_sha1
2467
 
 
2468
2462
    def get_rev_id_for_revno(self, revno, known_pair):
2469
2463
        """Return the revision id of a revno, given a later (revno, revid)
2470
2464
        pair in the same history.