mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Ran "2to3 -w -n -f print ./" and manually added imports. Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually. Also manually added imports to files, which used print as a function, but were missing the import. The scripts still work with Python 2. There are no intended behaviour changes. Bug: 942522 Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684 Reviewed-by: Dirk Pranke <dpranke@chromium.org> Commit-Queue: Dirk Pranke <dpranke@chromium.org> Auto-Submit: Raul Tambre <raul@tambre.ee>
55 lines
1.6 KiB
Python
Executable File
55 lines
1.6 KiB
Python
Executable File
#!/usr/bin/env python
|
|
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
"""Display log of checkins of one particular developer since a particular
|
|
date. Only works on git dependencies at the moment."""
|
|
|
|
from __future__ import print_function
|
|
|
|
import gclient_utils
|
|
import optparse
|
|
import os
|
|
import re
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def show_log(path, authors, since='1 week ago'):
|
|
"""Display log in a single git repo."""
|
|
|
|
author_option = ' '.join(['--author=' + author for author in authors])
|
|
command = ' '.join(['git log', author_option, '--since="%s"' % since,
|
|
'origin/master', '| git shortlog'])
|
|
status = subprocess.Popen(['sh', '-c', command],
|
|
cwd=path,
|
|
stdout=subprocess.PIPE).communicate()[0].rstrip()
|
|
|
|
if len(status.splitlines()) > 0:
|
|
print('---------- %s ----------' % path)
|
|
print(status)
|
|
|
|
|
|
def main():
|
|
"""Take no arguments."""
|
|
|
|
option_parser = optparse.OptionParser()
|
|
option_parser.add_option("-a", "--author", action="append", default=[])
|
|
option_parser.add_option("-s", "--since", default="1 week ago")
|
|
options, args = option_parser.parse_args()
|
|
|
|
root, entries = gclient_utils.GetGClientRootAndEntries()
|
|
|
|
# which entries map to a git repos?
|
|
paths = [k for k, v in entries.items() if not re.search('svn', v)]
|
|
paths.sort()
|
|
|
|
for path in paths:
|
|
dir = os.path.normpath(os.path.join(root, path))
|
|
show_log(dir, options.author, options.since)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|