Commit cd454025 authored by Peter Kasting's avatar Peter Kasting Committed by LUCI CQ

Revert "Reland "git-cl: Execute clang-format-diff.py using vpython.""

This reverts commit 87661afb.

Reason for revert: Still get:
OSError: Execution failed with error: [Error 2] The system cannot find the file specified.

Original change's description:
> Reland "git-cl: Execute clang-format-diff.py using vpython."
> 
> This is a reland of beec6607
> 
> Append the clang-format directory to the front of PATH instead of
> overwriting it.
> This allows vpython to be invoked.
> 
> Original change's description:
> > git-cl: Execute clang-format-diff.py using vpython.
> >
> > When running git-cl using vpython3, sys.executable is python3.
> > Execute clang-format-diff.py using vpython instead, since it has
> > not been migrated already.
> >
> > Bug: 1066187
> > Change-Id: I31556acb50ff4256706a313c1393eddad9f903f3
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2130926
> > Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> 
> Bug: 1066187
> Change-Id: I8b65549ef47587cef8492f8f76a037eb85a981fc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2132972
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com

Change-Id: I22566c829a83991e3749a039d0bd0ba7d8a56812
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1066187
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2133588Reviewed-by: 's avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
parent 9db428f4
......@@ -4750,22 +4750,21 @@ def _RunClangFormatDiff(opts, clang_diff_files, top_dir, upstream_commit):
if opts.diff:
sys.stdout.write(stdout)
else:
env = os.environ.copy()
env['PATH'] = str(os.path.dirname(clang_format_tool))
try:
script = clang_format.FindClangFormatScriptInChromiumTree(
'clang-format-diff.py')
except clang_format.NotFoundError as e:
DieWithError(e)
cmd = ['vpython', script, '-p0']
cmd = [sys.executable, script, '-p0']
if not opts.dry_run and not opts.diff:
cmd.append('-i')
diff_cmd = BuildGitDiffCmd('-U0', upstream_commit, clang_diff_files)
diff_output = RunGit(diff_cmd).encode('utf-8')
env = os.environ.copy()
env['PATH'] = (
str(os.path.dirname(clang_format_tool)) + os.pathsep + env['PATH'])
stdout = RunCommand(cmd, stdin=diff_output, cwd=top_dir, env=env)
if opts.diff:
sys.stdout.write(stdout)
......
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