gclient: don't make SVN-specific calls in RunOnDeps

Replaced a call to CaptureSVNStatus with a SCMWrapper::status

gclient: store gclient_entries as a dict

Currently we only store the relative path for entries.
We need to also store the url so that learn the repo type: git or snv.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@27370 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient.py b/gclient.py
index f9a02f8..da87501 100755
--- a/gclient.py
+++ b/gclient.py
@@ -72,6 +72,7 @@
 import logging
 import optparse
 import os
+import pprint
 import re
 import stat
 import sys
@@ -374,12 +375,9 @@
     Args:
       entries: A sequence of solution names.
     """
-    text = "entries = [\n"
-    for entry in entries:
-      text += "  \"%s\",\n" % entry
-    text += "]\n"
-    FileWrite(os.path.join(self._root_dir, self._options.entries_filename),
-              text)
+    text = "entries = \\\n" + pprint.pformat(entries, 2) + '\n'
+    file_path = os.path.join(self._root_dir, self._options.entries_filename)
+    FileWrite(file_path, text)
 
   def _ReadEntries(self):
     """Read the .gclient_entries file for the given client.
@@ -748,11 +746,13 @@
         e_dir = os.path.join(self._root_dir, entry_fixed)
         # Use entry and not entry_fixed there.
         if entry not in entries and os.path.exists(e_dir):
-          if not self._options.delete_unversioned_trees or \
-             gclient_scm.CaptureSVNStatus(e_dir):
+          file_list = []
+          scm = gclient_scm.CreateSCM(prev_entries[entry], self._root_dir,
+                                      entry_fixed)
+          scm.status(self._options, [], file_list)
+          if not self._options.delete_unversioned_trees or file_list:
             # There are modified files in this entry. Keep warning until
             # removed.
-            entries[entry] = None
             print(("\nWARNING: \"%s\" is no longer part of this client.  "
                    "It is recommended that you manually remove it.\n") %
                       entry_fixed)