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

Unified Diff: gclient.py

Issue 2923005: Add testing for a solution entry where url = None. (Closed)
Patch Set: merged with HEAD Created 10 years, 5 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_smoketest.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 8791d5300dfdf59dd445ed73b2da8ffa3f047d8b..788b96b92040054a207efb34c56b0cbd58a55a5d 100644
--- a/gclient.py
+++ b/gclient.py
@@ -720,9 +720,11 @@ solutions = [
# Inner helper to generate base url and rev tuple
def GetURLAndRev(name, original_url):
+ if not original_url:
+ return None
url, _ = gclient_utils.SplitUrlRevision(original_url)
scm = gclient_scm.CreateSCM(original_url, self.root_dir(), name)
- return (url, scm.revinfo(self._options, [], None))
+ return '%s@%s' % (url, scm.revinfo(self._options, [], None))
# text of the snapshot gclient file
new_gclient = ""
@@ -735,9 +737,9 @@ solutions = [
name = solution.name
if name in solution_names:
raise gclient_utils.Error("solution %s specified more than once" % name)
- (url, rev) = GetURLAndRev(name, solution.url)
- entries[name] = "%s@%s" % (url, rev)
- solution_names[name] = "%s@%s" % (url, rev)
+ url = GetURLAndRev(name, solution.url)
+ entries[name] = url
+ solution_names[name] = url
# Process the dependencies next (sort alphanumerically to ensure that
# containing directories get populated first and for readability)
@@ -748,11 +750,9 @@ solutions = [
# First pass for direct dependencies.
for d in deps_to_process:
if type(deps[d]) == str:
- (url, rev) = GetURLAndRev(d, deps[d])
- entries[d] = "%s@%s" % (url, rev)
+ entries[d] = GetURLAndRev(d, deps[d])
elif isinstance(deps[d], self.FileImpl):
- (url, rev) = GetURLAndRev(d, deps[d].file_location)
- entries[d] = "%s@%s" % (url, rev)
+ entries[d] = GetURLAndRev(d, deps[d].file_location)
# Second pass for inherited deps (via the From keyword)
for d in deps_to_process:
@@ -765,8 +765,11 @@ solutions = [
sub_deps = Dependency(self, deps[d].module_name, sub_deps_base_url
).ParseDepsFile(False)
url = deps[d].GetUrl(d, sub_deps_base_url, self.root_dir(), sub_deps)
- (url, rev) = GetURLAndRev(d, url)
- entries[d] = "%s@%s" % (url, rev)
+ entries[d] = GetURLAndRev(d, url)
+
+ # Build the snapshot configuration string
+ if self._options.snapshot:
+ url = entries.pop(name)
# Build the snapshot configuration string
if self._options.snapshot:
« no previous file with comments | « no previous file | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698