Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index 1dcb1fe8ca7bcc1bb0033997cd035a157f2b9e0c..b5b969cafba77f2e91836295f623f484d1fe2e80 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -21,6 +21,7 @@ import textwrap |
| import threading |
| import urllib2 |
| import urlparse |
| +import glob |
|
Dirk Pranke
2013/07/30 22:01:00
Nit: sort the imports so that this is up by json.
Bei Zhang
2013/08/12 22:43:12
Done.
|
| try: |
| import readline # pylint: disable=F0401,W0611 |
| @@ -38,6 +39,7 @@ import rietveld |
| import scm |
| import subprocess2 |
| import watchlists |
| +import owners_finder |
| DEFAULT_SERVER = 'https://codereview.appspot.com' |
| @@ -2076,6 +2078,33 @@ def CMDset_close(parser, args): |
| return 0 |
| +def CMDowners(parser, args): |
| + """interactively find the owners for reviewing""" |
| + parser.add_option( |
| + '--no-color', |
| + action='store_true', |
| + help='Use this option to disable color output') |
| + options, args = parser.parse_args(args) |
| + |
| + if args: |
| + if len(args) > 1: |
| + parser.error('Unknown args') |
| + cl = Changelist() |
| + base_branch = args[0] |
| + else: |
| + cl = Changelist() |
| + # Default to diffing against the common ancestor of the upstream branch. |
| + base_branch = RunGit(['merge-base', cl.GetUpstreamBranch(), 'HEAD']).strip() |
|
Dirk Pranke
2013/07/30 22:01:00
What happens if we try to run this on an svn check
Bei Zhang
2013/08/12 22:43:12
This part is copied from CMDpresubmit. So I guess
|
| + |
| + change = cl.GetChange(base_branch, None) |
| + return owners_finder.OwnersFinder( |
| + [f.LocalPath() for f in |
| + cl.GetChange(base_branch, None).AffectedFiles()], |
| + change.RepositoryRoot(), |
| + fopen=file, os_path=os.path, glob=glob.glob, |
| + disable_color=options.no_color).run() |
| + |
| + |
| def CMDformat(parser, args): |
| """Runs clang-format on the diff.""" |
| CLANG_EXTS = ['.cc', '.cpp', '.h'] |