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

Side by Side Diff: recipe_engine/package.py

Issue 1887653003: Fix deps_path not being absolute. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import ast 5 import ast
6 import collections 6 import collections
7 import contextlib 7 import contextlib
8 import copy 8 import copy
9 import difflib 9 import difflib
10 import functools 10 import functools
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 self.allow_fetch = allow_fetch 115 self.allow_fetch = allow_fetch
116 116
117 @classmethod 117 @classmethod
118 def from_proto_file(cls, repo_root, proto_file, allow_fetch, deps_path=None): 118 def from_proto_file(cls, repo_root, proto_file, allow_fetch, deps_path=None):
119 buf = proto_file.read() 119 buf = proto_file.read()
120 120
121 recipes_path = str(buf.recipes_path).replace('/', os.sep) 121 recipes_path = str(buf.recipes_path).replace('/', os.sep)
122 122
123 if not deps_path: 123 if not deps_path:
124 deps_path = os.path.join(repo_root, recipes_path, '.recipe_deps') 124 deps_path = os.path.join(repo_root, recipes_path, '.recipe_deps')
125
125 return cls(os.path.join(repo_root, recipes_path), 126 return cls(os.path.join(repo_root, recipes_path),
126 deps_path, 127 os.path.abspath(deps_path),
127 repo_root, 128 repo_root,
128 allow_fetch) 129 allow_fetch)
129 130
130 131
131 class CommitInfo(object): 132 class CommitInfo(object):
132 """Holds the stuff we need to know about a commit.""" 133 """Holds the stuff we need to know about a commit."""
133 def __init__(self, author, message, repo_id, revision): 134 def __init__(self, author, message, repo_id, revision):
134 self.author = author 135 self.author = author
135 self.message = message 136 self.message = message
136 self.repo_id = repo_id 137 self.repo_id = repo_id
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 >>> d = { 'x': 1, 'y': 2 } 863 >>> d = { 'x': 1, 'y': 2 }
863 >>> sorted(_updated(d, { 'y': 3, 'z': 4 }).items()) 864 >>> sorted(_updated(d, { 'y': 3, 'z': 4 }).items())
864 [('x', 1), ('y', 3), ('z', 4)] 865 [('x', 1), ('y', 3), ('z', 4)]
865 >>> sorted(d.items()) 866 >>> sorted(d.items())
866 [('x', 1), ('y', 2)] 867 [('x', 1), ('y', 2)]
867 """ 868 """
868 869
869 d = copy.copy(d) 870 d = copy.copy(d)
870 d.update(updates) 871 d.update(updates)
871 return d 872 return d
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698