Merge pull request #9403 from jdufresne/get-revision

Harmonize return type of VersionControl.get_revision in subclasses
This commit is contained in:
Stéphane Bidoul 2021-01-01 19:36:20 +01:00 committed by GitHub
commit 35604e5a4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 1 deletions

View File

@ -96,6 +96,7 @@ class Bazaar(VersionControl):
@classmethod
def get_revision(cls, location):
# type: (str) -> str
revision = cls.run_command(
['revno'], cwd=location,
)

View File

@ -345,6 +345,7 @@ class Git(VersionControl):
@classmethod
def get_revision(cls, location, rev=None):
# type: (str, Optional[str]) -> str
if rev is None:
rev = 'HEAD'
current_rev = cls.run_command(

View File

@ -97,6 +97,7 @@ class Mercurial(VersionControl):
@classmethod
def get_revision(cls, location):
# type: (str) -> str
"""
Return the repository-local changeset revision number, as an integer.
"""

View File

@ -49,6 +49,7 @@ class Subversion(VersionControl):
@classmethod
def get_revision(cls, location):
# type: (str) -> str
"""
Return the maximum revision for all files under a given location
"""
@ -73,7 +74,7 @@ class Subversion(VersionControl):
dirs[:] = []
continue # not part of the same svn tree, skip it
revision = max(revision, localrev)
return revision
return str(revision)
@classmethod
def get_netloc_and_auth(cls, netloc, scheme):