Commit 2e38de7b authored by msb@chromium.org's avatar msb@chromium.org

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
parent e28e4986
...@@ -72,6 +72,7 @@ import errno ...@@ -72,6 +72,7 @@ import errno
import logging import logging
import optparse import optparse
import os import os
import pprint
import re import re
import stat import stat
import sys import sys
...@@ -374,12 +375,9 @@ class GClient(object): ...@@ -374,12 +375,9 @@ class GClient(object):
Args: Args:
entries: A sequence of solution names. entries: A sequence of solution names.
""" """
text = "entries = [\n" text = "entries = \\\n" + pprint.pformat(entries, 2) + '\n'
for entry in entries: file_path = os.path.join(self._root_dir, self._options.entries_filename)
text += " \"%s\",\n" % entry FileWrite(file_path, text)
text += "]\n"
FileWrite(os.path.join(self._root_dir, self._options.entries_filename),
text)
def _ReadEntries(self): def _ReadEntries(self):
"""Read the .gclient_entries file for the given client. """Read the .gclient_entries file for the given client.
...@@ -748,11 +746,13 @@ class GClient(object): ...@@ -748,11 +746,13 @@ class GClient(object):
e_dir = os.path.join(self._root_dir, entry_fixed) e_dir = os.path.join(self._root_dir, entry_fixed)
# Use entry and not entry_fixed there. # Use entry and not entry_fixed there.
if entry not in entries and os.path.exists(e_dir): if entry not in entries and os.path.exists(e_dir):
if not self._options.delete_unversioned_trees or \ file_list = []
gclient_scm.CaptureSVNStatus(e_dir): 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 # There are modified files in this entry. Keep warning until
# removed. # removed.
entries[entry] = None
print(("\nWARNING: \"%s\" is no longer part of this client. " print(("\nWARNING: \"%s\" is no longer part of this client. "
"It is recommended that you manually remove it.\n") % "It is recommended that you manually remove it.\n") %
entry_fixed) entry_fixed)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment