This will help remove confusion when depot_tools' recipes.py
ends up in PATH.
BUG=699120
Change-Id: Id4c21b0cc6bb022ea2c21145abe76bebb0a8d9c1
Reviewed-on: https://chromium-review.googlesource.com/458430
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Note that because it is now a gerrit footer, it both appears in the same block
as the Change-Id footer (no blank line between them), and isn't guaranteed to be
above the Change-Id footer. This doesn't matter during "git cl upload", when
a Change-Id hasn't been allocated yet, but will show up during "git cl
description".
Bug: 681184
Change-Id: I2ab6fc13be8e992709618a666012410b1a7c02de
Reviewed-on: https://chromium-review.googlesource.com/446660
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
These methods are used to produce report in the next CL.
BUG=689543
Change-Id: I71b2705ac8b046103b4982d47f7ec97f8ef7818b
Reviewed-on: https://chromium-review.googlesource.com/455838
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
If the commit or cherry-pick command fails, git automatically drops
the user into a state where they can try to manually fix it. That's
great. But with the old call order, it would also leave the metadata
unset. This sets the issue and patchset number before doing the
potentially-failing heavy lifting, so that the branch will be in a
consistent state after the user finishes fixing up the failed command.
BUG=701130
Change-Id: I792b9fb9e61ba62626c19aa1837d21f8cd8f594e
Reviewed-on: https://chromium-review.googlesource.com/456039
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
The default BUG_LINE_FORMAT is the existing BUG=%s. Projects that wish
to begin using Gerrit-style footers like Bug: %s can now set this in
codereview.settings.
BUG=616753
Change-Id: I4470311a86db228eab2a1655ae884736cce8c380
Reviewed-on: https://chromium-review.googlesource.com/451565
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7-digit hashes are bogus, so I run with core.abbrev = 12.
Non-default settings for core.abbrev caused the git blame test to fail,
because it was hard-coded to look for exactly 7 digits. This change
allows an --abbrev option to be passed to the git-blame wrapper, and
ensures that the same value is used for the git-blame operation and the
computed expectation.
TEST=tests/git_common_test.py GitReadOnlyFunctionsTest.testBlame
Change-Id: I83cbf4dd7267ea36607119bef52f303d59c3f840
Reviewed-on: https://chromium-review.googlesource.com/451124
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Previously, if an OWNERS file included //foo/API_OWNERS, then the
code would get confused and think that it had already read and processed
//foo/OWNERS, transferring the contents of the former to the latter.
This was wrong. This change fixes the attribution and adds tests to make
sure we catch this in the future.
R=thakis@chromium.org
BUG=697156
Change-Id: I1f1b846cafac2ad6d792d2dccfce94911e9d15c3
Reviewed-on: https://chromium-review.googlesource.com/447962
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Gclient sometimes ignores "unmanaged": "False" in the gclient solution
if --revision <anything> is passed. This forces gclient to always
treat solutions deps as unmanaged.
BUG=693296
Change-Id: I91d5f4c9377fab0fde23cf15d1475779978820fa
Reviewed-on: https://chromium-review.googlesource.com/444098
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
This makes them accessible to presubmit scripts' PostUploadHook.
Fixed bugs where caching needed to be bypassed in order for
sequential PostUploadHooks to see each others' results.
BUG=688765
Change-Id: I56c0c6b6419e2474f4b7f701be036fb2a524f8e3
Reviewed-on: https://chromium-review.googlesource.com/439877
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
This ensures coverage is installed, rather than depending on it being
installed in your system.
BUG=671189
Change-Id: Id9d7c514b4db53963381c5269bee06c706b23751
Reviewed-on: https://chromium-review.googlesource.com/442050
Commit-Queue: Stephen Martinis <martiniss@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
The PostUploadHooks in the Chromium repository which add
CQ_INCLUDE_TRYBOTS entries to the issue description will be rewritten
in terms of this primitive, which will compose properly if multiple
sub-directories attempt to modify it.
BUG=688765
Change-Id: Icf72edb872f29af1e082038e96bc547504edfd07
Reviewed-on: https://chromium-review.googlesource.com/438925
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Also fixes git cl description <url> by propagating codereview host information
in all cases.
BUG=681704
R=agable@chromium.org
Change-Id: Ia79c10b19d72b5a8797a1428ad8a79c8f4480901
Reviewed-on: https://chromium-review.googlesource.com/431036
Reviewed-by: Aaron Gable <agable@chromium.org>
This reverts commit 66c50ea1f1.
Reason for revert:
Breaks some OWNERS checks. See https://crbug.com/684270 for details.
Original change's description:
> Fix OWNERS canned check to avoid duplicate output.
>
> 1. Update PanProjectChecks() to supply source_filter to CheckOwners().
> This prevents files under e.g. third_party/WebKit being checked both
> by the top-level and sub-directory PRESUBMIT rules.
> 2. Fix CheckOwners() to list missing-OWNERS only for the sub-directory
> it is invoked on, rather than the whole CL. This prevents files under
> sub-directories with their own PRESUBMIT rule, within the same repo,
> from causing OWNERS to be checked for files outside that directory.
>
> BUG=
>
> Reviewed-on: https://chromium-review.googlesource.com/426003
TBR=wez@chromium.org,dcheng@chromium.org
BUG=684270
Change-Id: I094818a6fa3e16fbac0d37d2596a40210611ee05
Reviewed-on: https://chromium-review.googlesource.com/431656
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Git cl decides if git-numberer is enabled on a repository by writing
Gerrit's project.config from refs/meta/config into a tempfile, which is
then queried using `git config -f tempfile --get ...`. The file itself
is only flushed, but not closed after writing because Python's
tempfile.NamedTemporaryFile is deleted on closing. This worked fine on
Linix/Mac, but not on Windows, where `git config` apparently doesn't see
file or its contents.
This CL rewrites the above using yet another contexmanager temp
directory into which a file is written and closed before git config is
ran.
R=machenbach@chromium.org,grt@chromium.org
BUG=683202
Change-Id: I7974d66b1b2b0478ab4b6f7ac04e547a4981c46c
Reviewed-on: https://chromium-review.googlesource.com/430719
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
On larger CLs, this can be used to see whether all needed LGTMs are
there on a dry run.
R=tandrii@chromium.org
Change-Id: I5fe4022feaca73d08ead9aed14ca270192740675
Reviewed-on: https://chromium-review.googlesource.com/426819
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: smut <smut@chromium.org>
It looks like this regressed when we switched from specifying CCs
via the refspec arguments to using the API.
BUG=680605
Change-Id: Iabd397b639989f050932188b1a1aa488639ffbbe
Reviewed-on: https://chromium-review.googlesource.com/427344
Reviewed-by: Andrew Bonventre <andybons@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
1. Update PanProjectChecks() to supply source_filter to CheckOwners().
This prevents files under e.g. third_party/WebKit being checked both
by the top-level and sub-directory PRESUBMIT rules.
2. Fix CheckOwners() to list missing-OWNERS only for the sub-directory
it is invoked on, rather than the whole CL. This prevents files under
sub-directories with their own PRESUBMIT rule, within the same repo,
from causing OWNERS to be checked for files outside that directory.
BUG=
Change-Id: I9bd5677a69efe9c78b4174a917780d6688991a38
Reviewed-on: https://chromium-review.googlesource.com/426003
Commit-Queue: James Weatherall <wez@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This is a follow-up to https://chromium-review.googlesource.com/c/419148/;
the purpose is to confirm that the behavior is how we want it to be when
there are presubmit errors and warnings.
BUG=671683
Change-Id: I5b295c200d3db1a374e4294bdd78a777ae36c832
Reviewed-on: https://chromium-review.googlesource.com/420975
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
None of these methods are called anymore.
BUG=475320
Change-Id: I2f21a326069cf3e65af179f4e61fa15093b73b07
Reviewed-on: https://chromium-review.googlesource.com/423122
Reviewed-by: Katie Thomas <katthomas@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>