Add more explanation to parse_netloc()'s docstrings.

This addresses @pradyunsg's review comments.
This commit is contained in:
Chris Jerdonek 2018-07-17 08:31:19 -07:00
parent e37a17cc09
commit 977d0740fb
2 changed files with 8 additions and 0 deletions

View File

@ -218,6 +218,11 @@ class VersionControl(object):
Parse the repository URL's netloc, and return the new netloc to use
along with auth information.
This is mainly for the Subversion class to override, so that auth
information can be provided via the --username and --password options
instead of through the URL. For other subclasses like Git without
such an option, auth information must stay in the URL.
Returns: (netloc, username, password).
"""
return netloc, None, None

View File

@ -133,6 +133,9 @@ class Subversion(VersionControl):
def parse_netloc(self, netloc):
"""
Parse out and remove from the netloc the auth information.
This allows the auth information to be provided via the --username
and --password options instead of via the URL.
"""
if '@' not in netloc:
return netloc, None, None