Fix package installing with VCS branch for Python 2.7.3 // Resolve #885

This commit is contained in:
Ivan Kravets
2017-01-24 17:36:34 +02:00
parent 682f1cb798
commit 92b2782af8
2 changed files with 7 additions and 3 deletions

View File

@@ -32,6 +32,9 @@ PlatformIO 3.0
* Use C++11 by default for CLion IDE based projects * Use C++11 by default for CLion IDE based projects
(`pull #873 <https://github.com/platformio/platformio-core/pull/873>`_) (`pull #873 <https://github.com/platformio/platformio-core/pull/873>`_)
* Escape project path when Glob matching is used * Escape project path when Glob matching is used
* Fixed package installing with VCS branch for Python 2.7.3
(`issue #885 <https://github.com/platformio/platformio-core/issues/885>`_)
------- -------

View File

@@ -28,18 +28,19 @@ class VCSClientFactory(object):
def newClient(src_dir, remote_url): def newClient(src_dir, remote_url):
result = urlparse(remote_url) result = urlparse(remote_url)
type_ = result.scheme type_ = result.scheme
tag = None
if not type_ and remote_url.startswith("git@"): if not type_ and remote_url.startswith("git@"):
type_ = "git" type_ = "git"
elif "+" in result.scheme: elif "+" in result.scheme:
type_, _ = result.scheme.split("+", 1) type_, _ = result.scheme.split("+", 1)
remote_url = remote_url[len(type_) + 1:] remote_url = remote_url[len(type_) + 1:]
if result.fragment: if "#" in remote_url:
remote_url = remote_url.rsplit("#", 1)[0] remote_url, tag = remote_url.rsplit("#", 1)
if not type_: if not type_:
raise PlatformioException("VCS: Unknown repository type %s" % raise PlatformioException("VCS: Unknown repository type %s" %
remote_url) remote_url)
obj = getattr(modules[__name__], "%sClient" % type_.title())( obj = getattr(modules[__name__], "%sClient" % type_.title())(
src_dir, remote_url, result.fragment) src_dir, remote_url, tag)
assert isinstance(obj, VCSClientBase) assert isinstance(obj, VCSClientBase)
return obj return obj