OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |