Chromium Code Reviews| 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..fd368b98541e545850d77b1cb6897d3600c18fc2 100644 |
| --- a/recipe_modules/git_cl/api.py |
| +++ b/recipe_modules/git_cl/api.py |
| @@ -14,12 +14,23 @@ class GitClApi(recipe_api.RecipeApi): |
| return self.m.step( |
| name, [self.package_repo_resource('git_cl.py')] + args, **kwargs) |
| - def get_description(self, **kwargs): |
| - return self('description', ['-d'], stdout=self.m.raw_io.output(), **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" |
|
iannucci
2016/05/12 00:25:52
why make them optional and defaulted to None then?
martiniss
2016/05/13 19:23:56
If one of them is provided, the other must be prov
iannucci
2016/05/23 19:52:33
Acknowledged.
|
| + args.append(patch) |
| + args.append('--%s' % codereview) |
| + |
| + return self('description', args, 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) |