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

Side by Side Diff: scm.py

Issue 3338003: Remove scm.SVN.Run() and all stdout argument to more calls. (Closed)
Patch Set: Created 10 years, 3 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 unified diff | Download patch
« no previous file with comments | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """SCM-specific utility classes.""" 5 """SCM-specific utility classes."""
6 6
7 import cStringIO 7 import cStringIO
8 import glob 8 import glob
9 import os 9 import os
10 import re 10 import re
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 return (False, current_version) 299 return (False, current_version)
300 elif ver > min_ver: 300 elif ver > min_ver:
301 return (True, current_version) 301 return (True, current_version)
302 return (True, current_version) 302 return (True, current_version)
303 303
304 304
305 class SVN(object): 305 class SVN(object):
306 current_version = None 306 current_version = None
307 307
308 @staticmethod 308 @staticmethod
309 def Run(args, **kwargs):
310 """Wrappers to gclient_utils.CheckCallAndFilterAndHeader()."""
311 return gclient_utils.CheckCallAndFilterAndHeader(['svn'] + args,
312 always=True, **kwargs)
313
314 @staticmethod
315 def Capture(args, in_directory=None, print_error=True): 309 def Capture(args, in_directory=None, print_error=True):
316 """Runs svn, capturing output sent to stdout as a string. 310 """Runs svn, capturing output sent to stdout as a string.
317 311
318 Args: 312 Args:
319 args: A sequence of command line parameters to be passed to svn. 313 args: A sequence of command line parameters to be passed to svn.
320 in_directory: The directory where svn is to be run. 314 in_directory: The directory where svn is to be run.
321 315
322 Returns: 316 Returns:
323 The output sent to stdout as a string. 317 The output sent to stdout as a string.
324 """ 318 """
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 if not SVN.current_version: 842 if not SVN.current_version:
849 SVN.current_version = SVN.Capture(['--version']).split()[2] 843 SVN.current_version = SVN.Capture(['--version']).split()[2]
850 current_version_list = map(only_int, SVN.current_version.split('.')) 844 current_version_list = map(only_int, SVN.current_version.split('.'))
851 for min_ver in map(int, min_version.split('.')): 845 for min_ver in map(int, min_version.split('.')):
852 ver = current_version_list.pop(0) 846 ver = current_version_list.pop(0)
853 if ver < min_ver: 847 if ver < min_ver:
854 return (False, SVN.current_version) 848 return (False, SVN.current_version)
855 elif ver > min_ver: 849 elif ver > min_ver:
856 return (True, SVN.current_version) 850 return (True, SVN.current_version)
857 return (True, SVN.current_version) 851 return (True, SVN.current_version)
OLDNEW
« no previous file with comments | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698