mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Adds --merged-only command line option
Adds status:merged to gerrit filter. Bug: 878433 Change-Id: Ica081fa0cd0e8a267ec0a8d711f749b4e91faec5 Reviewed-on: https://chromium-review.googlesource.com/1194310 Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org> Commit-Queue: Peter Lee <pkl@chromium.org>
This commit is contained in:
@@ -375,13 +375,16 @@ class MyActivity(object):
|
||||
max_age = max_age.days * 24 * 3600 + max_age.seconds
|
||||
user_filter = 'owner:%s' % owner if owner else 'reviewer:%s' % reviewer
|
||||
filters = ['-age:%ss' % max_age, user_filter]
|
||||
# TODO(cjhopman): Should abandoned changes be filtered out when
|
||||
# merged_only is not enabled?
|
||||
if self.options.merged_only:
|
||||
filters.append('status:merged')
|
||||
|
||||
issues = self.gerrit_changes_over_rest(instance, filters)
|
||||
self.show_progress()
|
||||
issues = [self.process_gerrit_issue(instance, issue)
|
||||
for issue in issues]
|
||||
|
||||
# TODO(cjhopman): should we filter abandoned changes?
|
||||
issues = filter(self.filter_issue, issues)
|
||||
issues = sorted(issues, key=lambda i: i['modified'], reverse=True)
|
||||
|
||||
@@ -955,6 +958,12 @@ def main():
|
||||
const=logging.ERROR,
|
||||
help='Suppress non-error messages.'
|
||||
)
|
||||
parser.add_option(
|
||||
'-M', '--merged-only',
|
||||
action='store_true',
|
||||
dest='merged_only',
|
||||
default=False,
|
||||
help='Shows only changes that have been merged.')
|
||||
parser.add_option(
|
||||
'-o', '--output', metavar='<file>',
|
||||
help='Where to output the results. By default prints to stdout.')
|
||||
|
||||
Reference in New Issue
Block a user