Commit 288054da authored by maruel@chromium.org's avatar maruel@chromium.org

Add --ignore to gclient recurse

This permits running git grep over the dependencies. With --ignore, gclient
recurse continues even if nothing is found in a dependency. Without this flag,
git grep returns 1 when nothing is found, causing gclient to stop processing the
remaining dependencies.

TBR=nsylvain@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@124914 0039d316-1c4b-4281-b951-d872f2087c98
parent 47ca0ee5
......@@ -578,8 +578,12 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
if parsed_url:
env['GCLIENT_URL'] = parsed_url
if os.path.isdir(cwd):
gclient_utils.CheckCallAndFilter(
args, cwd=cwd, env=env, print_stdout=True)
try:
gclient_utils.CheckCallAndFilter(
args, cwd=cwd, env=env, print_stdout=True)
except subprocess2.CalledProcessError:
if not options.ignore:
raise
else:
print >> sys.stderr, 'Skipped missing %s' % cwd
......@@ -1154,6 +1158,8 @@ def CMDrecurse(parser, args):
parser.disable_interspersed_args()
parser.add_option('-s', '--scm', action='append', default=[],
help='choose scm types to operate upon')
parser.add_option('-i', '--ignore', action='store_true',
help='continue processing in case of non zero return code')
options, args = parser.parse_args(args)
if not args:
print >> sys.stderr, 'Need to supply a command!'
......
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