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

Unified Diff: recipe_engine/package.py

Issue 2669033007: [recipe_engine] Fix a couple path-related bugs. (Closed)
Patch Set: Make unittests take dependency on recipe_engine Created 3 years, 11 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 | « recipe_engine/loader.py ('k') | recipes/engine_tests/recipe_paths.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/package.py
diff --git a/recipe_engine/package.py b/recipe_engine/package.py
index dd235ffedfbd55b677be3bffb0de9019a75633ab..e4e54a13299ed000dc5033f50ec6f37d87c4fab8 100644
--- a/recipe_engine/package.py
+++ b/recipe_engine/package.py
@@ -166,7 +166,7 @@ class RepoSpec(object):
return not (self == other)
def proto_file(self, context):
- """Returns the ProtoFile of the recipes config file in this repository.
+ """Returns the ProtoFile of the recipes config file in this repository.
Requires a good checkout."""
return ProtoFile(InfraRepoConfig().to_recipes_cfg(self.repo_root(context)))
@@ -316,7 +316,7 @@ class PathRepoSpec(RepoSpec):
return self.path
def proto_file(self, context):
- """Returns the ProtoFile of the recipes config file in this repository.
+ """Returns the ProtoFile of the recipes config file in this repository.
Requires a good checkout."""
return ProtoFile(InfraRepoConfig().to_recipes_cfg(self.path))
@@ -509,6 +509,9 @@ class PackageSpec(object):
@classmethod
def spec_for_dep(cls, dep):
"""Returns a RepoSpec for the given dependency protobuf."""
+ url = str(dep.url)
+ if url.startswith("file://"):
+ return PathRepoSpec(url[7:])
martiniss 2017/02/02 23:44:56 nit: change this to return PathRepoSpec(url[len(
iannucci 2017/02/02 23:58:08 Done.
if dep.repo_type in (package_pb2.DepSpec.GIT, package_pb2.DepSpec.GITILES):
if dep.repo_type == package_pb2.DepSpec.GIT:
@@ -516,7 +519,7 @@ class PackageSpec(object):
elif dep.repo_type == package_pb2.DepSpec.GITILES:
backend = fetch.GitilesBackend()
return GitRepoSpec(str(dep.project_id),
- str(dep.url),
+ url,
str(dep.branch),
str(dep.revision),
str(dep.path_override),
« no previous file with comments | « recipe_engine/loader.py ('k') | recipes/engine_tests/recipe_paths.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698