/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: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
 
51
51
class RevisionSpec_git(RevisionSpec):
52
 
    """Selects a revision using a Subversion revision number."""
53
 
 
54
 
    help_txt = """Selects a revision using a Git revision sha1.
 
52
    """Selects a revision using a Git commit SHA1."""
 
53
 
 
54
    help_txt = """Selects a revision using a Git commit SHA1.
 
55
 
 
56
    Selects a revision using a Git commit SHA1, short or long.
 
57
 
 
58
    This works for both native Git repositories and Git revisions
 
59
    imported into Bazaar repositories.
55
60
    """
56
61
 
57
62
    prefix = 'git:'
107
112
    def _match_on(self, branch, revs):
108
113
        loc = self.spec.find(':')
109
114
        git_sha1 = self.spec[loc + 1:].encode("utf-8")
110
 
        if len(git_sha1) > 40 or not valid_git_sha1(git_sha1):
 
115
        if (len(git_sha1) > 40 or len(git_sha1) < 4 or
 
116
                not valid_git_sha1(git_sha1)):
111
117
            raise InvalidRevisionSpec(self.user_spec, branch)
112
118
        from . import (
113
119
            lazy_check_versions,