/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/git/revspec.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 23:15:15 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7183.
  • Revision ID: jelmer@jelmer.uk-20181116231515-zqd2yn6kj8lfydyp
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# Please note that imports are delayed as much as possible here since
22
22
# if DWIM revspecs are supported this module is imported by __init__.py.
23
23
 
24
 
from .. import version_info as breezy_version
25
24
from ..errors import (
26
25
    InvalidRevisionId,
27
26
    InvalidRevisionSpec,
70
69
            )
71
70
 
72
71
        bzr_revid = getattr(branch.repository, "lookup_foreign_revision_id",
73
 
                              default_mapping.revision_id_foreign_to_bzr)(sha1)
 
72
                            default_mapping.revision_id_foreign_to_bzr)(sha1)
74
73
        try:
75
74
            if branch.repository.has_revision(bzr_revid):
76
75
                return RevisionInfo.from_revision_id(branch, bzr_revid)
110
109
 
111
110
    def _match_on(self, branch, revs):
112
111
        loc = self.spec.find(':')
113
 
        git_sha1 = self.spec[loc+1:].encode("utf-8")
 
112
        git_sha1 = self.spec[loc + 1:].encode("utf-8")
114
113
        if len(git_sha1) > 40 or not valid_git_sha1(git_sha1):
115
114
            raise InvalidRevisionSpec(self.user_spec, branch)
116
115
        from . import (