/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 breezy/plugins/git/object_store.py

  • Committer: Jelmer Vernooij
  • Date: 2018-07-01 21:13:21 UTC
  • mto: This revision was merged to the branch mainline in revision 7027.
  • Revision ID: jelmer@jelmer.uk-20180701211321-dazu15ry3tcvny2l
Fix some git tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
from ...revision import (
48
48
    NULL_REVISION,
49
49
    )
 
50
from ...sixish import viewitems
50
51
from ...testament import(
51
52
    StrictTestament3,
52
53
    )
162
163
    if expected_sha is None:
163
164
        return
164
165
    if len(expected_sha) == 40:
165
 
        if expected_sha != object.sha().hexdigest():
 
166
        if expected_sha != object.sha().hexdigest().encode('ascii'):
166
167
            raise AssertionError("Invalid sha for %r: %s" % (object,
167
168
                expected_sha))
168
169
    elif len(expected_sha) == 20:
392
393
 
393
394
    def __iter__(self):
394
395
        return ((self.store[object_id], path) for (object_id, path) in
395
 
                self.objects.iteritems())
 
396
                viewitems(self.objects))
396
397
 
397
398
 
398
399
class BazaarObjectStore(BaseObjectStore):
612
613
                        entry.revision)
613
614
                except KeyError:
614
615
                    # no-change merge?
615
 
                    return self._reconstruct_blobs(
616
 
                        [(entry.file_id, entry.revision, None)]).next().id
 
616
                    return next(self._reconstruct_blobs(
 
617
                        [(entry.file_id, entry.revision, None)])).id
617
618
            elif entry.kind == 'tree-reference':
618
619
                # FIXME: Make sure the file id is the root id
619
620
                return self._lookup_revision_sha1(entry.reference_revision)
751
752
            elif kind == "blob":
752
753
                (fileid, revision) = type_data
753
754
                blobs = self._reconstruct_blobs([(fileid, revision, sha)])
754
 
                return blobs.next()
 
755
                return next(blobs)
755
756
            elif kind == "tree":
756
757
                (fileid, revid) = type_data
757
758
                try: