Files
chromium_depot_tools/gerrit_util.py
Gennady Tsitovich 90eb3fe8ba Add --allow-conflicts option to git cl cherry-pick
This CL adds a new --allow-conflicts flag to the `git cl cherry-pick`
command. This allows users to create cherry-pick CLs on Gerrit even if
they result in merge conflicts. The created CL will be in a WIP state,
allowing the user to resolve conflicts in the Gerrit UI or locally.

Additionally, this CL:
- Updates `CMDcherry_pick` to print a regex-friendly warning if the
  created cherry-pick contains conflicts:
  "Warning: Change <URL> contains merge conflicts"
  (needed for the Chrome Cherry Picker)
- Fixes some existing test failures in `gerrit_util_test.py` related to
  authentication mocking in the current environment.
- Adds unit tests for the new flag in both `git_cl_test.py`
  and `gerrit_util_test.py`.

Bug: 439992429
Change-Id: I306e21329688a31a63c9996f1405f5ef5ad07108
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7319362
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gennady Tsitovich <gtsitovich@google.com>
2026-01-06 03:47:38 -08:00

82 KiB