Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: gclient.py

Issue 7840033: Urls with /@ won't be processed correctly when used as a requirements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index e2257724e535cc6c646f84f6ab637851dac89b43..69b524c3233ee034a0d7ddcc78141097e1d0c591 100644
--- a/gclient.py
+++ b/gclient.py
@@ -172,6 +172,14 @@ class Dependency(GClientKeywords, gclient_utils.WorkItem):
# Required dependencies to run before running this one:
self.requirements = set()
+ # Post process the url to remove trailing slashes.
+ if isinstance(self.url, basestring):
+ # urls are sometime incorrectly written as proto://host/path/@rev. Replace
+ # it to proto://host/path@rev.
+ if self.url.count('@') > 1:
+ raise gclient_utils.Error('Invalid url "%s"' % self.url)
+ self.url = self.url.replace('/@', '@')
+
self._FindDependencies()
# Sanity checks
@@ -263,8 +271,10 @@ class Dependency(GClientKeywords, gclient_utils.WorkItem):
break
if not found_dep:
raise gclient_utils.Error(
- 'Couldn\'t find %s in %s, referenced by %s\n%s' % (
- sub_target, ref.name, self.name, str(self.root_parent())))
+ 'Couldn\'t find %s in %s, referenced by %s (parent: %s)\n%s' % (
+ sub_target, ref.name, self.name, self.parent.name,
+ str(self.root_parent())))
+
# Call LateOverride() again.
parsed_url = found_dep.LateOverride(found_dep.url)
logging.info('%s, %s to %s' % (self.name, url, parsed_url))
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698