Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index 3ee62f6b3a2a5ef25c564313fc0dc9e078107890..cee622116eaec54713bf9fa6bfd7b4c33fa497f3 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -9,6 +9,7 @@ |
| import difflib |
| from distutils.version import LooseVersion |
| +import glob |
| import json |
| import logging |
| import optparse |
| @@ -38,6 +39,7 @@ import rietveld |
| import scm |
| import subprocess2 |
| import watchlists |
| +import owners_finder |
| DEFAULT_SERVER = 'https://codereview.appspot.com' |
| @@ -2085,6 +2087,35 @@ 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) |
| + |
| + author = RunGit(['config', 'user.email']).strip() or None |
| + |
| + if args: |
| + if len(args) > 1: |
| + parser.error('Unknown args') |
| + cl = Changelist() |
|
M-A Ruel
2013/09/16 20:33:13
Move it above line 2100, so you can remove this on
Bei Zhang
2013/09/19 23:21:43
Done.
|
| + 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() |
| + |
| + change = cl.GetChange(base_branch, None) |
| + return owners_finder.OwnersFinder( |
| + [f.LocalPath() for f in |
| + cl.GetChange(base_branch, None).AffectedFiles()], |
| + change.RepositoryRoot(), author, |
| + 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'] |