remove weekly and wtf commands
Those 2 commands have been broken since the introduction of gcs dep as it tries to run a git command aginst path to a gcs dep. Since nobody has complained so far, it's safe to assume the command is never used by anyone today, therefore, it should be safe to delete. Bug: 345486495 Change-Id: Ia27e5e8486f790234bd66e890e995f1d5c14f9c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5608374 Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Commit-Queue: Yiwei Zhang <yiwzhang@google.com>changes/74/5608374/2
parent
02091c6148
commit
413b558c6c
@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# 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."""
|
||||
|
||||
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/HEAD', '| 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()
|
||||
@ -1,77 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# 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 active git branches and code changes in a chromiumos workspace."""
|
||||
|
||||
import gclient_utils
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def show_dir(full_name, relative_name, color):
|
||||
"""Display active work in a single git repo."""
|
||||
def show_name():
|
||||
"""Display the directory name."""
|
||||
|
||||
if color:
|
||||
sys.stdout.write('========= %s[44m%s[37m%s%s[0m ========\n' %
|
||||
(chr(27), chr(27), relative_name, chr(27)))
|
||||
else:
|
||||
sys.stdout.write('========= %s ========\n' % relative_name)
|
||||
|
||||
lines_printed = 0
|
||||
|
||||
cmd = ['git', 'branch', '-v']
|
||||
if color:
|
||||
cmd.append('--color')
|
||||
|
||||
branch = subprocess.Popen(cmd, cwd=full_name,
|
||||
stdout=subprocess.PIPE).communicate()[0].rstrip()
|
||||
|
||||
if len(branch.splitlines()) > 1:
|
||||
if lines_printed == 0:
|
||||
show_name()
|
||||
lines_printed += 1
|
||||
print(branch)
|
||||
|
||||
status = subprocess.Popen(['git', 'status'],
|
||||
cwd=full_name,
|
||||
stdout=subprocess.PIPE).communicate()[0].rstrip()
|
||||
|
||||
if len(status.splitlines()) > 2:
|
||||
if lines_printed == 0:
|
||||
show_name()
|
||||
if lines_printed == 1:
|
||||
print('---------------')
|
||||
print(status)
|
||||
|
||||
|
||||
def main():
|
||||
"""Take no arguments."""
|
||||
|
||||
color = False
|
||||
|
||||
if os.isatty(1):
|
||||
color = True
|
||||
|
||||
base = os.path.basename(os.getcwd())
|
||||
root, entries = gclient_utils.GetGClientRootAndEntries()
|
||||
|
||||
# which entries map to a git repos?
|
||||
raw = [k for k, v in entries.items() if v and not re.search('svn', v)]
|
||||
raw.sort()
|
||||
|
||||
# We want to use the full path for testing, but we want to use the relative
|
||||
# path for display.
|
||||
fulldirs = [os.path.normpath(os.path.join(root, p)) for p in raw]
|
||||
reldirs = [re.sub('^' + base, '.', p) for p in raw]
|
||||
|
||||
for full_path, relative_path in zip(fulldirs, reldirs):
|
||||
show_dir(full_path, relative_path, color)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Loading…
Reference in New Issue