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

Unified Diff: gcl.py

Issue 387067: Fix looking for local versions of cached files (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
===================================================================
--- gcl.py (revision 33630)
+++ gcl.py (working copy)
@@ -114,8 +114,6 @@
return None
if (not os.path.exists(cached_file) or
os.stat(cached_file).st_mtime > max_age):
- local_dir = os.path.dirname(os.path.abspath(filename))
- local_base = os.path.basename(filename)
dir_info = SVN.CaptureInfo(".")
repo_root = dir_info["Repository Root"]
if use_root:
@@ -124,23 +122,9 @@
url_path = dir_info["URL"]
content = ""
while True:
- # First, look for a locally modified version of the file if we can.
- r = ""
- if not use_root:
- local_path = os.path.join(local_dir, local_base)
- r = SVN.CaptureStatus((local_path,))
- rc = -1
- if r:
- status = r[0][0]
- rc = 0
- if not rc and status[0] in ('A','M'):
- content = ReadFile(local_path)
- rc = 0
- else:
- # Look in the repository if we didn't find something local.
- svn_path = url_path + "/" + filename
- content, rc = RunShellWithReturnCode(["svn", "cat", svn_path])
-
+ # Look in the repository at the current level for the file.
+ svn_path = url_path + "/" + filename
+ content, rc = RunShellWithReturnCode(["svn", "cat", svn_path])
if not rc:
# Exit the loop if the file was found. Override content.
break
@@ -151,7 +135,6 @@
break
# Go up one level to try again.
url_path = os.path.dirname(url_path)
- local_dir = os.path.dirname(local_dir)
# Write a cached version even if there isn't a file, so we don't try to
# fetch it each time.
WriteFile(cached_file, content)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698