Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index ce7c6df12595df173b196555d64144ae51bb4493..0bba495b4eaf26fc621cf6c2295b28803586034a 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -33,7 +33,8 @@ import rietveld |
| import scm |
| import subprocess2 |
| import watchlists |
| - |
| +import owners_finder |
| +import glob |
|
M-A Ruel
2013/04/24 01:32:20
another line
Bei Zhang
2013/04/24 03:29:02
Done.
|
| DEFAULT_SERVER = 'https://codereview.appspot.com' |
| POSTUPSTREAM_HOOK_PATTERN = '.git/hooks/post-cl-%s' |
| @@ -1893,6 +1894,30 @@ def CMDset_close(parser, args): |
| cl.CloseIssue() |
| return 0 |
|
M-A Ruel
2013/04/24 01:32:20
2 lines
Bei Zhang
2013/04/24 03:29:02
Done.
|
| +def CMDowners(parser, args): |
| + """Interactively find the owners for reviewing""" |
| + group = optparse.OptionGroup(parser, "Find owners options") |
|
M-A Ruel
2013/04/24 01:32:20
Use ' instead of "
Bei Zhang
2013/04/24 03:29:02
Done.
|
| + group.add_option( |
| + "--no-color", dest="ncolor", default=False, |
|
M-A Ruel
2013/04/24 01:32:20
no need to default=False
I'd prefer to not use des
Bei Zhang
2013/04/24 03:29:02
Done.
|
| + action="store_true", |
| + help=("Use this option to disable color output")) |
| + parser.add_option_group(group) |
| + opt, args = parser.parse_args(args) |
| + cl = Changelist() |
| + |
|
M-A Ruel
2013/04/24 01:32:20
if len(args) > 1:
parser.error('Unknown args
Bei Zhang
2013/04/24 03:29:02
Done.
|
| + 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 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=opt.ncolor).run() |
| def Command(name): |
| return getattr(sys.modules[__name__], 'CMD' + name, None) |