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

Unified Diff: scm.py

Issue 501106: Get rid of gcl.ReadFile. (Closed)
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 | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm.py
diff --git a/scm.py b/scm.py
index 58f26c6a9855f4b85ea8132d7f535d1bb7a6a2a7..757935d7507b12d9ee2225873d0d94f6a5c7aa60 100644
--- a/scm.py
+++ b/scm.py
@@ -416,11 +416,7 @@ class SVN(object):
# We know the diff will be incorrectly formatted. Fix it.
if SVN.IsMoved(filename):
- # The file is "new" in the patch sense. Generate a homebrew diff.
- # We can't use ReadFile() since it's not using binary mode.
- file_handle = open(filename, 'rb')
- file_content = file_handle.read()
- file_handle.close()
+ file_content = gclient_utils.FileRead(filename, 'rb')
# Prepend '+' to every lines.
file_content = ['+' + i for i in file_content.splitlines(True)]
nb_lines = len(file_content)
« no previous file with comments | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698