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

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

Issue 1917433002: Generalize patch_project to patch root conversion. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: -line long 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 | « recipe_modules/gclient/config.py ('k') | 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 urlparse 5 import urlparse
6 6
7 from recipe_engine import recipe_api 7 from recipe_engine import recipe_api
8 8
9 9
10 class RietveldApi(recipe_api.RecipeApi): 10 class RietveldApi(recipe_api.RecipeApi):
11 def calculate_issue_root(self, extra_patch_project_roots=None): 11 def calculate_issue_root(self, extra_patch_project_roots=None):
12 """Returns path where a patch should be applied to based on "patch_project". 12 """Returns path where a patch should be applied to based on "patch_project".
13 13
14 YOU SHOULD NOT USE THIS METHOD. Put this into gclient's config as
15 patch_projects instead, and with luck you won't need to use
16 calculate_patch_root from gclient api.
17 TODO(tandrii): remove this method completely. See http://crbug.com/605563.
18
14 Maps Rietveld's "patch_project" to a path of directories relative to 19 Maps Rietveld's "patch_project" to a path of directories relative to
15 api.gclient.c.solutions[0].name which describe where to place the patch. 20 api.gclient.c.solutions[0].name which describe where to place the patch.
16 21
17 Args: 22 Args:
18 extra_patch_project_roots: Dict mapping project names to relative roots. 23 extra_patch_project_roots: Dict mapping project names to relative roots.
19 24
20 Returns: 25 Returns:
21 Relative path or empty string if patch_project is not set or path for a 26 Relative path or empty string if patch_project is not set or path for a
22 given is unknown. 27 given is unknown.
23 """ 28 """
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 self.m.path['depot_tools'].join('apply_issue.py'), [ 85 self.m.path['depot_tools'].join('apply_issue.py'), [
81 '-r', self.m.path['checkout'].join(*root_pieces), 86 '-r', self.m.path['checkout'].join(*root_pieces),
82 '-i', issue_number, 87 '-i', issue_number,
83 '-p', self.m.properties['patchset'], 88 '-p', self.m.properties['patchset'],
84 '-s', rietveld_url, 89 '-s', rietveld_url,
85 '--no-auth'], 90 '--no-auth'],
86 ) 91 )
87 step_result.presentation.links['Applied issue %s' % issue_number] = ( 92 step_result.presentation.links['Applied issue %s' % issue_number] = (
88 urlparse.urljoin(rietveld_url, str(issue_number))) 93 urlparse.urljoin(rietveld_url, str(issue_number)))
89 94
OLDNEW
« no previous file with comments | « recipe_modules/gclient/config.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698