~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

Fix some test failures caused by the switch from unicode to UTF-8-encoded strs for revision IDs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
            return {}
216
216
 
217
217
        path = self.bzrdir._path_for_remote_call(self._client)
218
 
        response = self._client.call2('Repository.get_revision_graph', path, revision_id.encode('utf8'))
 
218
        assert type(revision_id) is str
 
219
        response = self._client.call2(
 
220
            'Repository.get_revision_graph', path, revision_id)
219
221
        assert response[0][0] in ('ok', 'nosuchrevision'), 'unexpected response code %s' % (response[0],)
220
222
        if response[0][0] == 'ok':
221
223
            coded = response[1].read_body_bytes()
222
 
            lines = coded.decode('utf8').split('\n')
 
224
            lines = coded.split('\n')
223
225
            revision_graph = {}
224
226
            # FIXME
225
227
            for line in lines:
238
240
            # The null revision is always present.
239
241
            return True
240
242
        path = self.bzrdir._path_for_remote_call(self._client)
241
 
        response = self._client.call('Repository.has_revision', path, revision_id.encode('utf8'))
 
243
        response = self._client.call('Repository.has_revision', path, revision_id)
242
244
        assert response[0] in ('ok', 'no'), 'unexpected response code %s' % (response,)
243
245
        return response[0] == 'ok'
244
246
 
248
250
        if revid in (None, NULL_REVISION):
249
251
            fmt_revid = ''
250
252
        else:
251
 
            fmt_revid = revid.encode('utf8')
 
253
            fmt_revid = revid
252
254
        if committers is None or not committers:
253
255
            fmt_committers = 'no'
254
256
        else:
533
535
        # root data.
534
536
        return False
535
537
 
 
538
    def iter_reverse_revision_history(self, revision_id):
 
539
        self._ensure_real()
 
540
        return self._real_repository.iter_reverse_revision_history(revision_id)
 
541
 
536
542
 
537
543
class RemoteBranchLockableFiles(object):
538
544
    """A 'LockableFiles' implementation that talks to a smart server.
748
754
        response = self._client.call('Branch.last_revision_info', path)
749
755
        assert response[0] == 'ok', 'unexpected response code %s' % (response,)
750
756
        revno = int(response[1])
751
 
        last_revision = response[2].decode('utf8')
 
757
        last_revision = response[2]
752
758
        if last_revision == '':
753
759
            last_revision = NULL_REVISION
754
760
        return (revno, last_revision)
761
767
        path = self.bzrdir._path_for_remote_call(self._client)
762
768
        response = self._client.call2('Branch.revision_history', path)
763
769
        assert response[0][0] == 'ok', 'unexpected response code %s' % (response[0],)
764
 
        result = response[1].read_body_bytes().decode('utf8').split('\x00')
 
770
        result = response[1].read_body_bytes().split('\x00')
765
771
        if result == ['']:
766
772
            return []
767
773
        return result
815
821
    def is_locked(self):
816
822
        return self._lock_count >= 1
817
823
 
 
824
    def set_last_revision_info(self, revno, revision_id):
 
825
        self._ensure_real()
 
826
        return self._real_branch.set_last_revision_info(revno, revision_id)
 
827
 
818
828
 
819
829
class RemoteWorkingTree(object):
820
830