Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ensure_dependencies.py

Issue 4542760560361472: Issue 2310 - Handle alternative syntax of Git SSH URLs (Closed)
Patch Set: Created April 29, 2015, 5:10 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ensure_dependencies.py
diff --git a/ensure_dependencies.py b/ensure_dependencies.py
index d8af9e718b27d802acd7cde70301341220c6f7eb..ddea6e1ad765edb0ea1acab953a03b8e3e83fd33 100755
--- a/ensure_dependencies.py
+++ b/ensure_dependencies.py
@@ -190,7 +190,12 @@ def ensure_repo(parentrepo, target, roots, sourcename):
if os.path.exists(roots[type]):
url = os.path.join(roots[type], sourcename)
else:
- url = urlparse.urljoin(roots[type], sourcename)
+ if (type == "git" and "@" in sourcename and
+ not urlparse.urlsplit(sourcename).scheme):
+ # Handle alternative syntax of Git SSH URLS
+ url = "ssh://" + sourcename.replace(":", "/", 1)
+ else:
Wladimir Palant 2015/04/29 18:03:05 This seems to be the wrong place to do it. What we
+ url = urlparse.urljoin(roots[type], sourcename)
logging.info("Cloning repository %s into %s" % (url, target))
repo_types[type].clone(url, target)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld