mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Make gclient_scm.py use cache_dir
Instead of having custom logic for dealing with cache directories, use git_cache.py to populate caches. Also fixes a bug in git_cache.py where it was looking for lockfiles in cwd rather than the cache dir. Other changes: * _Run now returns output. * Always print to stdout in CheckCallAndFilterOutput, even if it gets a carriage return. This is done because git progress report are carriage returns and not newlines and we don't want everything on the same line and not strip out the CRs. * Removed members changed tests, its not very useful to know a new import is added. BUG=339171 Review URL: https://codereview.chromium.org/180243006 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@254248 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -240,8 +240,9 @@ def CMDunlock(parser, args):
|
||||
url = args[0]
|
||||
repo_dirs = [os.path.join(options.cache_dir, UrlToCacheDir(url))]
|
||||
else:
|
||||
repo_dirs = [path for path in os.listdir(options.cache_dir)
|
||||
if os.path.isdir(path)]
|
||||
repo_dirs = [os.path.join(options.cache_dir, path)
|
||||
for path in os.listdir(options.cache_dir)
|
||||
if os.path.isdir(os.path.join(options.cache_dir, path))]
|
||||
lockfiles = [repo_dir + '.lock' for repo_dir in repo_dirs
|
||||
if os.path.exists(repo_dir + '.lock')]
|
||||
|
||||
@@ -255,6 +256,9 @@ def CMDunlock(parser, args):
|
||||
for repo_dir in repo_dirs:
|
||||
lf = Lockfile(repo_dir)
|
||||
if lf.break_lock():
|
||||
config_lock = os.path.join(repo_dir, 'config.lock')
|
||||
if os.path.exists(config_lock):
|
||||
os.remove(config_lock)
|
||||
unlocked.append(repo_dir)
|
||||
else:
|
||||
untouched.append(repo_dir)
|
||||
|
||||
Reference in New Issue
Block a user