| Index: git_cl.py
|
| diff --git a/git_cl.py b/git_cl.py
|
| index 2fd5d852f15d892dc6ae968fbd2ceee33cdb4666..871aefee0580f08c5d1c572797c808bc4a571d55 100755
|
| --- a/git_cl.py
|
| +++ b/git_cl.py
|
| @@ -33,7 +33,7 @@ import rietveld
|
| import scm
|
| import subprocess2
|
| import watchlists
|
| -
|
| +import find_owners
|
|
|
| DEFAULT_SERVER = 'https://codereview.appspot.com'
|
| POSTUPSTREAM_HOOK_PATTERN = '.git/hooks/post-cl-%s'
|
| @@ -1808,6 +1808,28 @@ def CMDset_close(parser, args):
|
| cl.CloseIssue()
|
| return 0
|
|
|
| +def CMDowners(parser, args):
|
| + """Interactively find the owners for reviewing"""
|
| + group = optparse.OptionGroup(parser, "Find owners options")
|
| + group.add_option(
|
| + "--no-color", dest="ncolor", default=False,
|
| + action="store_true",
|
| + help=("Use this option to disable color output"))
|
| + parser.add_option_group(group)
|
| + opt, args = parser.parse_args(args)
|
| + cl = Changelist()
|
| +
|
| + if args:
|
| + base_branch = args[0]
|
| + else:
|
| + # 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 find_owners.FindOwners(
|
| + [f.LocalPath() for f in
|
| + cl.GetChange(base_branch, None).AffectedFiles()],
|
| + change.RepositoryRoot(), opt.ncolor).run()
|
|
|
| def Command(name):
|
| return getattr(sys.modules[__name__], 'CMD' + name, None)
|
|
|