Add json output for gclient.
This is in order to support 'features' like got_revision for build systems
unwilling to scrape the human-readable output of gclient in order to extract
basic information :)
R=agable@chromium.org, maruel@chromium.org
BUG=265618
Review URL: https://chromiumcodereview.appspot.com/23753008
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@225046 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index 465d172..fa16be6 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -104,9 +104,11 @@
'GetCheckoutRoot',
'GetRevisionDate',
'GetUsableRev',
+ 'Svnversion',
'RunCommand',
'cleanup',
'diff',
+ 'name',
'nag_max',
'nag_timer',
'pack',
@@ -198,6 +200,9 @@
cwd=self.root_dir,
file_list=files_list)
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
+
self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
@@ -228,6 +233,8 @@
cwd=self.root_dir,
file_list=files_list)
gclient_scm.gclient_utils.rmtree(self.base_path)
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
@@ -352,6 +359,8 @@
['checkout', self.url, self.base_path, '--force', '--ignore-externals'],
cwd=self.root_dir,
file_list=files_list)
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
@@ -386,6 +395,9 @@
gclient_scm.scm.SVN.Capture(['--version', '--quiet'], None
).AndReturn('1.5.1')
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
+
additional_args = []
if options.manually_grab_svn_rev:
additional_args = ['--revision', str(file_info['Revision'])]
@@ -425,6 +437,9 @@
gclient_scm.scm.SVN._CaptureInfo([file_info['URL']], None
).AndReturn(file_info)
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
+
self.mox.ReplayAll()
files_list = []
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
@@ -466,6 +481,9 @@
gclient_scm.os.path.islink(join(self.base_path, 'dir')).AndReturn(False)
gclient_scm.gclient_utils.rmtree(join(self.base_path, 'dir'))
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
+
self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
@@ -515,6 +533,9 @@
gclient_scm.scm.SVN._CaptureInfo([file_info['URL']], None
).AndReturn(file_info)
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
+
self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
@@ -585,6 +606,9 @@
gclient_scm.scm.SVN._CaptureInfo([file_info['URL']], None
).AndReturn(file_info)
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
+
self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
@@ -618,6 +642,9 @@
gclient_scm.scm.SVN._CaptureInfo([file_info['URL']], None
).AndReturn(file_info)
+ gclient_scm.scm.SVN._CaptureInfo([], self.base_path+'/.'
+ ).AndReturn({'Revision': 100})
+
self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
@@ -799,6 +826,7 @@
'cache_locks',
'cleanup',
'diff',
+ 'name',
'nag_max',
'nag_timer',
'pack',