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

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

Issue 1651323002: Revert of Adds bot_update to depot_tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Update .gitignore for safety Created 4 years, 10 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 | « infra/recipe_modules/rietveld/__init__.py ('k') | infra/recipe_modules/rietveld/example.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 import urlparse
6
7 from recipe_engine import recipe_api
8
9 class RietveldApi(recipe_api.RecipeApi):
10 def calculate_issue_root(self, extra_patch_project_roots=None):
11 """Returns path where a patch should be applied to based on "patch_project".
12
13 Maps Rietveld's "patch_project" to a path of directories relative to
14 api.gclient.c.solutions[0].name which describe where to place the patch.
15
16 Args:
17 extra_patch_project_roots: Dict mapping project names to relative roots.
18
19 Returns:
20 Relative path or empty string if patch_project is not set or path for a
21 given is unknown.
22 """
23 # Property 'patch_project' is set by Rietveld, 'project' is set by git-try
24 # when TRYSERVER_PROJECT is present in codereview.settings.
25 patch_project = (self.m.properties.get('patch_project') or
26 self.m.properties.get('project'))
27
28 # Please avoid adding projects into this hard-coded list unless your project
29 # CLs are being run by multiple recipes. Instead pass patch_project_roots to
30 # ensure_checkout.
31 patch_project_roots = {
32 'angle/angle': ['third_party', 'angle'],
33 'blink': ['third_party', 'WebKit'],
34 'v8': ['v8'],
35 'luci-py': ['luci'],
36 'recipes-py': ['recipes-py'],
37 }
38
39 # Make sure to update common projects (above) with extra projects (and not
40 # vice versa, so that recipes can override default values if needed.
41 if extra_patch_project_roots:
42 patch_project_roots.update(extra_patch_project_roots)
43
44 path_parts = patch_project_roots.get(patch_project)
45 return self.m.path.join(*path_parts) if path_parts else ''
OLDNEW
« no previous file with comments | « infra/recipe_modules/rietveld/__init__.py ('k') | infra/recipe_modules/rietveld/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698