Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: weekly

Issue 1602020: Adding weekly tool to help with weekly snippets (Closed)
Patch Set: . Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gclient_utils.py ('k') | wtf » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Display log of checkins of one particular developer since a particular
7 date. Only works on git dependencies at the moment."""
8
9 import gclient_utils
10 import optparse
11 import os
12 import re
13 import subprocess
14 import sys
15
16
17 def show_log(path, authors, since='1 week ago'):
18 """Display log in a single git repo."""
19
20 author_option = ' '.join(['--author=' + author for author in authors])
21 command = ' '.join(['git log', author_option, '--since="%s"' % since,
22 'origin/master', '| git shortlog'])
23 status = subprocess.Popen(['sh', '-c', command],
24 cwd=path,
25 stdout=subprocess.PIPE).communicate()[0].rstrip()
26
27 if len(status.splitlines()) > 0:
28 print '---------- %s ----------' % path
29 print status
30
31
32 def main():
33 """Take no arguments."""
34
35 option_parser = optparse.OptionParser()
36 option_parser.add_option("-a", "--author", action="append", default=[])
37 option_parser.add_option("-s", "--since", default="1 week ago")
38 options, args = option_parser.parse_args()
39
40 root, entries = gclient_utils.GetGClientRootAndEntries()
41
42 # which entries map to a git repos?
43 paths = [k for k, v in entries.items() if not re.search('svn', v)]
44 paths.sort()
45
46 for path in paths:
47 dir = os.path.normpath(os.path.join(root, path))
48 show_log(dir, options.author, options.since)
49
50
51 if __name__ == '__main__':
52 main()
OLDNEW
« no previous file with comments | « gclient_utils.py ('k') | wtf » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698