Commit 78cba525 authored by maruel@chromium.org's avatar maruel@chromium.org

gclient recurse fails if .gclient_entries doesn't exist.

Prints a meaningful message instead of throwing an exception.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@62920 0039d316-1c4b-4281-b951-d872f2087c98
parent 733bc0fa
......@@ -878,7 +878,13 @@ def CMDrecurse(parser, args):
parser.add_option('-s', '--scm', action='append', default=[],
help='choose scm types to operate upon')
options, args = parser.parse_args(args)
root, entries = gclient_utils.GetGClientRootAndEntries()
root_and_entries = gclient_utils.GetGClientRootAndEntries()
if not root_and_entries:
print >> sys.stderr, (
'You need to run gclient sync at least once to use \'recurse\'.\n'
'This is because .gclient_entries needs to exist and be up to date.')
return 1
root, entries = root_and_entries
scm_set = set()
for scm in options.scm:
scm_set.update(scm.split(','))
......
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