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

Side by Side Diff: recipe_modules/tryserver/api.py

Issue 1927403003: Avoid computing patch_root in get_files_affected_by_patch. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 contextlib 5 import contextlib
6 import hashlib 6 import hashlib
7 7
8 from recipe_engine import recipe_api 8 from recipe_engine import recipe_api
9 9
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 authentication=authentication) 142 authentication=authentication)
143 elif storage == PATCH_STORAGE_SVN: 143 elif storage == PATCH_STORAGE_SVN:
144 return self.apply_from_svn(cwd) 144 return self.apply_from_svn(cwd)
145 elif storage == PATCH_STORAGE_GIT: 145 elif storage == PATCH_STORAGE_GIT:
146 return self.apply_from_git(cwd) 146 return self.apply_from_git(cwd)
147 else: 147 else:
148 # Since this method is "maybe", we don't raise an Exception. 148 # Since this method is "maybe", we don't raise an Exception.
149 pass 149 pass
150 150
151 def get_files_affected_by_patch(self): 151 def get_files_affected_by_patch(self):
152 # DO NOT USE THIS. Use same method in gclient recipe_module.
153 # TODO(tandrii): remove this method completely.
152 git_diff_kwargs = {} 154 git_diff_kwargs = {}
153 issue_root = self.m.rietveld.calculate_issue_root() 155 issue_root = self.m.rietveld.calculate_issue_root()
154 if issue_root: 156 if issue_root:
155 git_diff_kwargs['cwd'] = self.m.path['checkout'].join(issue_root) 157 git_diff_kwargs['cwd'] = self.m.path['checkout'].join(issue_root)
156 step_result = self.m.git('diff', '--cached', '--name-only', 158 step_result = self.m.git('diff', '--cached', '--name-only',
157 name='git diff to analyze patch', 159 name='git diff to analyze patch',
158 stdout=self.m.raw_io.output(), 160 stdout=self.m.raw_io.output(),
159 step_test_data=lambda: 161 step_test_data=lambda:
160 self.m.raw_io.test_api.stream_output('foo.cc'), 162 self.m.raw_io.test_api.stream_output('foo.cc'),
161 **git_diff_kwargs) 163 **git_diff_kwargs)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 self.add_failure_reason(e.reason) 240 self.add_failure_reason(e.reason)
239 241
240 failure_hash = hashlib.sha1() 242 failure_hash = hashlib.sha1()
241 failure_hash.update(self.m.json.dumps(self._failure_reasons)) 243 failure_hash.update(self.m.json.dumps(self._failure_reasons))
242 244
243 step_result = self.m.step.active_result 245 step_result = self.m.step.active_result
244 step_result.presentation.properties['failure_hash'] = \ 246 step_result.presentation.properties['failure_hash'] = \
245 failure_hash.hexdigest() 247 failure_hash.hexdigest()
246 248
247 raise 249 raise
OLDNEW
« recipe_modules/gclient/api.py ('K') | « recipe_modules/gclient/example.expected/tryserver_win.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698