| Index: git_cl.py
|
| diff --git a/git_cl.py b/git_cl.py
|
| index ce7c6df12595df173b196555d64144ae51bb4493..df374cf93d00d16b583930073215506d4128db48 100755
|
| --- a/git_cl.py
|
| +++ b/git_cl.py
|
| @@ -17,6 +17,7 @@ import sys
|
| import textwrap
|
| import urlparse
|
| import urllib2
|
| +import glob
|
|
|
| try:
|
| import readline # pylint: disable=F0401,W0611
|
| @@ -33,6 +34,7 @@ import rietveld
|
| import scm
|
| import subprocess2
|
| import watchlists
|
| +import owners_finder
|
|
|
|
|
| DEFAULT_SERVER = 'https://codereview.appspot.com'
|
| @@ -1894,6 +1896,35 @@ def CMDset_close(parser, args):
|
| return 0
|
|
|
|
|
| +def CMDowners(parser, args):
|
| + """interactively find the owners for reviewing"""
|
| + group = optparse.OptionGroup(parser, 'Find owners options')
|
| + group.add_option(
|
| + '--no-color',
|
| + action='store_true',
|
| + help='Use this option to disable color output')
|
| + parser.add_option_group(group)
|
| + 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()
|
| +
|
| + 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 Command(name):
|
| return getattr(sys.modules[__name__], 'CMD' + name, None)
|
|
|
|
|