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

Unified Diff: scm.py

Issue 1560029: Fix File() to work with SVN 1.4 by using svn export in place... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 10 years, 8 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 | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm.py
===================================================================
--- scm.py (revision 44440)
+++ scm.py (working copy)
@@ -293,6 +293,7 @@
class SVN(object):
COMMAND = "svn"
+ current_version = None
@staticmethod
def Run(args, in_directory):
@@ -765,3 +766,22 @@
break
directory = parent
return GetCasedPath(directory)
+
+ @staticmethod
+ def AssertVersion(min_version):
+ """Asserts svn's version is at least min_version."""
+ def only_int(val):
+ if val.isdigit():
+ return int(val)
+ else:
+ return 0
+ if not SVN.current_version:
+ SVN.current_version = SVN.Capture(['--version']).split()[2]
+ current_version_list = map(only_int, SVN.current_version.split('.'))
+ for min_ver in map(int, min_version.split('.')):
+ ver = current_version_list.pop(0)
+ if ver < min_ver:
+ return (False, SVN.current_version)
+ elif ver > min_ver:
+ return (True, SVN.current_version)
+ return (True, SVN.current_version)
« 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