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

Unified Diff: recipe_modules/git_cl/api.py

Issue 1915833003: tryserver recipe_module: Add get_tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Minor things. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_modules/depot_tools/example.expected/win.json ('k') | recipe_modules/git_cl/example.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/git_cl/api.py
diff --git a/recipe_modules/git_cl/api.py b/recipe_modules/git_cl/api.py
index 0cb1f53e308e99302794adef384e686caf976fa8..8d2ad5c0d660600040b50f48ef25ca21420f4f0a 100644
--- a/recipe_modules/git_cl/api.py
+++ b/recipe_modules/git_cl/api.py
@@ -8,18 +8,34 @@ class GitClApi(recipe_api.RecipeApi):
def __call__(self, subcmd, args, name=None, **kwargs):
if not name:
name = 'git_cl ' + subcmd
+
+ if kwargs.get('suffix'):
+ name = name + ' (%s)' % kwargs.pop('suffix')
+
if 'cwd' not in kwargs:
kwargs['cwd'] = (self.c and self.c.repo_location) or None
return self.m.step(
- name, [self.package_repo_resource('git_cl.py')] + args, **kwargs)
+ name, [self.package_repo_resource('git_cl.py'), subcmd] + args,
+ **kwargs)
+
+ def get_description(self, patch=None, codereview=None, **kwargs):
+ args = ['-d']
+ if patch or codereview:
+ assert patch and codereview, "Both patch and codereview must be provided"
+ args.append('--%s' % codereview)
+ args.append(patch)
+
+ return self('description', args, stdout=self.m.raw_io.output(), **kwargs)
- def get_description(self, **kwargs):
- return self('description', ['-d'], stdout=self.m.raw_io.output(), **kwargs)
+ def set_description(self, description, patch=None, codereview=None, **kwargs):
+ args = ['-n', '-']
+ if patch or codereview:
+ assert patch and codereview, "Both patch and codereview must be provided"
+ args.append(patch)
+ args.append('--%s' % codereview)
- def set_description(self, description, **kwargs):
return self(
- 'description', ['-n', '-'],
- stdout=self.m.raw_io.output(),
+ 'description', args, stdout=self.m.raw_io.output(),
stdin=self.m.raw_io.input(data=description),
name='git_cl set description', **kwargs)
« no previous file with comments | « recipe_modules/depot_tools/example.expected/win.json ('k') | recipe_modules/git_cl/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698