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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-02 01:50:36 UTC
  • mfrom: (6973.13.15 python3-l)
  • Revision ID: breezy.the.bot@gmail.com-20180702015036-p7h30yemu44e4p01
Fix more tests on Python3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-l/+merge/348782

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
from .urls import git_url_to_bzr_url
77
77
 
78
78
from ...foreign import ForeignBranch
 
79
from ...sixish import viewitems
79
80
 
80
81
 
81
82
class GitPullResult(branch.PullResult):
82
83
    """Result of a pull from a Git branch."""
83
84
 
84
85
    def _lookup_revno(self, revid):
85
 
        if type(revid) is not str:
 
86
        if not isinstance(revid, bytes):
86
87
            raise TypeError(revid)
87
88
        # Try in source branch first, it'll be faster
88
89
        with self.target_branch.lock_read():
236
237
 
237
238
    def _set_tag_dict(self, to_dict):
238
239
        extra = set(self.refs.allkeys())
239
 
        for k, revid in to_dict.iteritems():
 
240
        for k, revid in viewitems(to_dict):
240
241
            name = tag_name_to_ref(k)
241
242
            if name in extra:
242
243
                extra.remove(name)
720
721
 
721
722
 
722
723
def _quick_lookup_revno(local_branch, remote_branch, revid):
723
 
    if type(revid) is not str:
 
724
    if not isinstance(revid, bytes):
724
725
        raise TypeError(revid)
725
726
    # Try in source branch first, it'll be faster
726
727
    with local_branch.lock_read():
1152
1153
            (stop_revno, stop_revision) = self.source.last_revision_info()
1153
1154
        else:
1154
1155
            stop_revno = self.source.revision_id_to_revno(stop_revision)
1155
 
        if type(stop_revision) is not str:
 
1156
        if not isinstance(stop_revision, bytes):
1156
1157
            raise TypeError(stop_revision)
1157
1158
        main_ref = self.target.ref
1158
1159
        refs = { main_ref: (None, stop_revision) }