Adding weekly tool to help with weekly snippets

This tool displays all checkins by one (or several) authors in the past week (or configurable time), in all dependencies. Only works on git dependencies currently.

Review URL: http://codereview.chromium.org/1602020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@44612 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
piman@chromium.org
2010-04-15 02:36:04 +00:00
parent 5756466130
commit f43d019e4c
3 changed files with 86 additions and 21 deletions

View File

@@ -323,3 +323,33 @@ def PathDifference(root, subpath):
# provided.
root = os.path.join(root, '')
return subpath[len(root):]
def FindFileUpwards(filename, path=None):
"""Search upwards from the a directory (default: current) to find a file."""
if not path:
path = os.getcwd()
path = os.path.realpath(path)
while True:
file_path = os.path.join(path, filename)
if os.path.isfile(file_path):
return file_path
(new_path, _) = os.path.split(path)
if new_path == path:
return None
path = new_path
def GetGClientRootAndEntries(path=None):
"""Returns the gclient root and the dict of entries."""
config_file = '.gclient_entries'
config_path = FindFileUpwards(config_file, path)
if not config_path:
print "Can't find", config_file
return None
env = {}
execfile(config_path, env)
config_dir = os.path.dirname(config_path)
return config_dir, env['entries']