Commit Graph

5 Commits (c4c3d5326e05fb339219e2eb2274f82032c293c7)

Author SHA1 Message Date
Gavin Mak 47a841a204 Handle empty diff in _diffs_to_change_files
An valid empty diff can be passed into _diffs_to_change_files if the
modified file's contents is same as upstream. In this case,
_diffs_to_change_files gets an IndexError.

Bug: b/336555565
Change-Id: I848e6016a1e8089473ff8a72d2e0142fbabfda9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5635166
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
10 months ago
Gavin Mak 715d94600f Add --generate_diff flag to presubmit_support.py
This flag allows a diff to be generated based on an upstream commit
for provided files and for checks to be run with on that diff.

Bug: b/323243527
Change-Id: Ia3f4ec50b15eabb90d391b9bc795fc4b35a35a08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5376402
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 year ago
Gavin Mak 00915b6874 Implement _ProvidedDiffCache.GetOldContents
Get old contents for a file using the provided diff.

Bug: b/323243527
Change-Id: Ib0e42cb1efc218002fae0b07c248b2806816b7c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5304396
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Gavin Mak 62dc9f462e Implement support for change info thru diff file
This will be used in cases where git workspace is unavailable.

Bug: b/323243527
Change-Id: I51056cfbac50f76a0de1b98cfec488d8f133e353
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5263021
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
1 year ago
Josip Sokcevic 1bdc5c8db4 [presubmit] Don't replace os.environ
Assigning os.environ the result of os.environ.copy() replaces it
with a standard dict. This breaks reflection into the actual
environment, as well as features such as case-insensitivity on
Windows, leading to undefined standard library behavior.

R=bryner, gavinmak

Bug: 1511316
Change-Id: I63d026387104ae92669256567854f8bf9d2397a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5133887
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Brian Ryner <bryner@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 year ago