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

Unified Diff: gclient.py

Issue 113288: Add a flag not print errors in CaptureSVN() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 7 months 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 | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
===================================================================
--- gclient.py (revision 15884)
+++ gclient.py (working copy)
@@ -491,7 +491,7 @@
SubprocessCall(c, in_directory)
-def CaptureSVN(args, in_directory):
+def CaptureSVN(args, in_directory=None, print_error=True):
"""Runs svn, capturing output sent to stdout as a string.
Args:
@@ -508,10 +508,14 @@
# the svn.exe executable, but shell=True makes subprocess on Linux fail
# when it's called with a list because it only tries to execute the
# first string ("svn").
+ stderr = None
+ if print_error:
+ stderr = subprocess.PIPE
return subprocess.Popen(c,
cwd=in_directory,
shell=(sys.platform == 'win32'),
- stdout=subprocess.PIPE).communicate()[0]
+ stdout=subprocess.PIPE,
+ stderr=stderr).communicate()[0]
def RunSVNAndGetFileList(args, in_directory, file_list):
@@ -560,7 +564,7 @@
capture_list=file_list)
-def CaptureSVNInfo(relpath, in_directory=None):
+def CaptureSVNInfo(relpath, in_directory=None, print_error=True):
"""Returns a dictionary from the svn info output for the given file.
Args:
@@ -568,7 +572,7 @@
the directory given by in_directory.
in_directory: The directory where svn is to be run.
"""
- output = CaptureSVN(["info", "--xml", relpath], in_directory)
+ output = CaptureSVN(["info", "--xml", relpath], in_directory, print_error)
dom = ParseXML(output)
result = {}
if dom:
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698