Refactor SubprocessCallAndFilter() to remove positional arguments.

This way the function is much more similar to subprocess.call(). Further changes
will be done, to be able to convert all the function, to be able to parallelize
output without corrupting it.

Used pylint to verify call graph correctness, causing some other unrelated
changes.

TEST=unit tests
BUG=none

Review URL: http://codereview.chromium.org/3117039

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57369 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index fa65a49..4503ef6 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -43,6 +43,7 @@
     self.mox.StubOutWithMock(gclient_scm.scm.SVN, 'Run')
     self.mox.StubOutWithMock(gclient_scm.scm.SVN, 'RunAndGetFileList')
     self._scm_wrapper = gclient_scm.CreateSCM
+    gclient_scm.sys.stdout.flush = lambda: None
 
 
 class SVNWrapperTestCase(BaseTestCase):
@@ -68,7 +69,7 @@
 
   def testDir(self):
     members = [
-        'AddAdditionalFlags', 'FullUrlForRelativeUrl', 'RunCommand',
+        'FullUrlForRelativeUrl', 'RunCommand',
         'cleanup', 'diff', 'export', 'pack', 'relpath', 'revert',
         'revinfo', 'runhooks', 'status', 'update',
         'updatesingle', 'url',
@@ -118,6 +119,8 @@
     options = self.Options(verbose=True)
     base_path = gclient_scm.os.path.join(self.root_dir, self.relpath)
     gclient_scm.os.path.isdir(base_path).AndReturn(False)
+    gclient_scm.scm.SVN.Capture(['--version']
+        ).AndReturn('svn, version 1.5.1 (r32289)')
     # It'll to a checkout instead.
     gclient_scm.os.path.exists(gclient_scm.os.path.join(base_path, '.git')
                                ).AndReturn(False)
@@ -126,7 +129,8 @@
     gclient_scm.os.path.exists(base_path).AndReturn(False)
     files_list = self.mox.CreateMockAnything()
     gclient_scm.scm.SVN.RunAndGetFileList(options.verbose,
-                                          ['checkout', self.url, base_path],
+                                          ['checkout', self.url, base_path,
+                                           '--force'],
                                           self.root_dir, files_list)
 
     self.mox.ReplayAll()
@@ -235,7 +239,8 @@
     gclient_scm.os.path.exists(base_path).AndReturn(False)
     files_list = self.mox.CreateMockAnything()
     gclient_scm.scm.SVN.RunAndGetFileList(options.verbose,
-                                          ['checkout', self.url, base_path],
+                                          ['checkout', self.url, base_path,
+                                           '--force'],
                                           self.root_dir, files_list)
     self.mox.ReplayAll()
     scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
@@ -307,7 +312,8 @@
     # When checking out a single file, we issue an svn checkout and svn update.
     files_list = self.mox.CreateMockAnything()
     gclient_scm.scm.SVN.Run(
-        ['checkout', '--depth', 'empty', self.url, base_path], self.root_dir)
+        ['checkout', '--depth', 'empty', self.url, base_path],
+        cwd=self.root_dir)
     gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, ['update', 'DEPS'],
         gclient_scm.os.path.join(self.root_dir, self.relpath), files_list)
 
@@ -345,7 +351,8 @@
     files_list = self.mox.CreateMockAnything()
     gclient_scm.scm.SVN.Run(
         ['export', gclient_scm.os.path.join(self.url, 'DEPS'),
-            gclient_scm.os.path.join(base_path, 'DEPS')], self.root_dir)
+            gclient_scm.os.path.join(base_path, 'DEPS')],
+        cwd=self.root_dir)
 
     self.mox.ReplayAll()
     scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
@@ -379,7 +386,8 @@
     # When checking out a single file, we issue an svn checkout and svn update.
     files_list = self.mox.CreateMockAnything()
     gclient_scm.scm.SVN.Run(
-        ['checkout', '--depth', 'empty', self.url, base_path], self.root_dir)
+        ['checkout', '--depth', 'empty', self.url, base_path],
+        cwd=self.root_dir)
     gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, ['update', 'DEPS'],
         gclient_scm.os.path.join(self.root_dir, self.relpath), files_list)