This includes a minor refactor so that some gclient_scm methods
can all share the same core.quotePath specifier.
R=iannucci
Bug: 792302
Change-Id: Iaadf190f5c0666787cf7c2ccda88d6dba9aace9b
Reviewed-on: https://chromium-review.googlesource.com/823131
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
This reverts commit 5908f9906d.
Reason for revert:
Introduces bugs when deleting files.
The reason is that
patchlevel = patchlevel or self.patchlevel
will evaluate to self.patchlevel also when patchlevel is 0, which is wrong.
Original change's description:
> Fix checkout.py issues when p.patchlevel > 1.
>
> When p.patchlevel > 1, p.filename does not correspond to the files that
> git-apply would modify.
>
> See bug for details
>
> Bug: 764294
> Change-Id: Icdb803056e306edb25238b2d9cdabd3ff175d8ed
> Reviewed-on: https://chromium-review.googlesource.com/663357
> Reviewed-by: Aaron Gable <agable@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=kjellander@chromium.org,agable@chromium.org,ehmaldonado@chromium.org
Change-Id: Ifa1f94602a023228cb32e5fe3fa07586b466981a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 764294
Reviewed-on: https://chromium-review.googlesource.com/663266
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
When p.patchlevel > 1, p.filename does not correspond to the files that
git-apply would modify.
See bug for details
Bug: 764294
Change-Id: Icdb803056e306edb25238b2d9cdabd3ff175d8ed
Reviewed-on: https://chromium-review.googlesource.com/663357
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This affects a bunch of files, but only changes comments,
and shouldn't make any difference to behavior.
The purpose is to slightly improve readability of pylint
disable comments.
Change-Id: Ic6cd0f8de792b31d91c6125f6da2616450b30f11
Reviewed-on: https://chromium-review.googlesource.com/420412
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
The ConfigParser module was renamed to configparser, so update the
two modules using it to try both (and default to the new name).
Review-Url: https://codereview.chromium.org/2076653002
After switching to a pure git workflow, most of the patchset we upload
to rietveld have git metadata. Apparently, however, the scripts here in
depot tools, which are used by the CQ and trybots, are ignoring that
and applying patches without taking advantage of git metadata.
In practice this causes people to rebase and reupload patches more than
necessary, even in the cases when it could be handled automatically by
means of a three way merge.
This change updates the GitCheckout class of depot_tools to use that.
BUG=416003
Review URL: https://codereview.chromium.org/577203002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292087 0039d316-1c4b-4281-b951-d872f2087c98
'git rev-parse <revision> will return same revision result with
newline appended if revision exists. The newline will cause the
following checkout command will fail, so remove the assignment.
BUG=
R=agable@chromium.org, rogerta@chromium.org
Review URL: https://codereview.chromium.org/317783008
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@277615 0039d316-1c4b-4281-b951-d872f2087c98
The contract for apply_patch is that it applies a patch on top of something, and
it either all applies cleanly or it fails. The something that is applied on can
be as clean or dirty without having apply_patch judge. The particular failure
condition was that we want to patch DEPS first (into the index), do some stuff,
then apply another patch on top of that. Apply_patch was failing because it
saw that there was a DEPS in the index already when it wasn't expecting one.
A fix that could've also worked is to run git diff --staged before applying the
patch, then subtract that list from found_files, but it still gets tricky then
because what if you want to apply an independent patch on top of
an already patched index?
Because apply_patch shouldn't need to be in the business of
keeping track of what the state of everything is like before and
after a patch (That's up to the patch application), the better thing would be to remove the assert
alltogether, and rely on "git apply" to complain if something doesn't apply.
BUG=370503
TBR=iannucci
Review URL: https://codereview.chromium.org/280023004
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@269526 0039d316-1c4b-4281-b951-d872f2087c98
For a bot_update Git world, we don't really want to commit patches. Instead
we just want to leave them unstaged.
BUG=370503
Review URL: https://codereview.chromium.org/280063003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@269489 0039d316-1c4b-4281-b951-d872f2087c98
Reason for revert:
Borked all the tryjobs due to missing --base_ref, needed to land with https://codereview.chromium.org/273543002/
Original issue's description:
> Have apply_patch.py/checkout.py stage git patches instead of committing them
>
> For a bot_update Git world, we don't really want to commit patches. Instead
> we just want to leave them unstaged.
>
> BUG=370503
> TEST=ran locally with and without flag
>
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=269468
TBR=maruel@chromium.org,agable@chromium.org,hinoka@google.com,iannucci@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=370503
Review URL: https://codereview.chromium.org/271283003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@269482 0039d316-1c4b-4281-b951-d872f2087c98
For a bot_update Git world, we don't really want to commit patches. Instead
we just want to leave them unstaged.
BUG=370503
TEST=ran locally with and without flag
Review URL: https://codereview.chromium.org/273543002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@269468 0039d316-1c4b-4281-b951-d872f2087c98
"name" is passed in as a function argument, but its "redelcared" in another iterator.
Yay dynamic scoping.
BUG=
Review URL: https://codereview.chromium.org/258173002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@268593 0039d316-1c4b-4281-b951-d872f2087c98
Apply_issue should not try to check if there are modified files within submodules.
BUG=
Review URL: https://codereview.chromium.org/246093002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@265115 0039d316-1c4b-4281-b951-d872f2087c98
The CQ should not be able to force push -- this allows it to wipe out legitimate
commits if something goes wrong internally. This happened recently, with a CQ
commit orphaning 20 commits from the previous few days. This may have happened
any number of times previously, probably only wiping out one commit at a time,
whenever there was a race between the CQ and a developer's direct commit+push.
Repositories should also protect themselves by disallowing force push in their
ACLs.
BUG=261619
Review URL: https://codereview.chromium.org/196573041
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@258092 0039d316-1c4b-4281-b951-d872f2087c98
Things have gone wrong. This change and subsequent fixes were not as safe as
they should have been. Reverting until we can diagnose exactly what has gone
wrong, and how to prevent it from happening again.
This reverts commit fa3c388ec5.
This reverts commit e569f50330.
This reverts commit 7dc11449f0.
R=rmistry@chromium.orgTBR=rmistry@chromium.org
BUG=261619
Review URL: https://codereview.chromium.org/200923005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@258003 0039d316-1c4b-4281-b951-d872f2087c98
This prevents apply_patch from attempting to check out a branch tracking 'origin/None'.
R=pgervais@chromium.org
Review URL: https://codereview.chromium.org/202483008
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@257763 0039d316-1c4b-4281-b951-d872f2087c98
The commit queue uses checkout.GitCheckout to manage the
local git repository. It resets it to a clean state,
commits patches locally, and pushes those changes to the
golden-source-of-truth repo.
This CL fixes the prepare() method to use the new git-cache
tool, and in the process makes it more consistent, more
readable, and more correct. It also makes minor changes to
other methods to bring them in line with the git-cache
approach.
R=iannucci@chromium.org, rmistry@chromium.org
BUG=261619
Review URL: https://codereview.chromium.org/175873003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@256681 0039d316-1c4b-4281-b951-d872f2087c98
This is to tackle the issue that slaves don't have global git vars set up.
BUG=339171
Review URL: https://codereview.chromium.org/175543006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@252705 0039d316-1c4b-4281-b951-d872f2087c98
This add --force to ignore the flag file.
This also passes --base_ref so we can specify which ref we're basing off of so that it does not incorrectly assert that it is basing off origin/master
BUG=339171
Review URL: https://codereview.chromium.org/171763003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@252464 0039d316-1c4b-4281-b951-d872f2087c98
The motivation for this CL is:
When a project is turned on to use GitCheckout with try job verifiers, then the CQ crashes because of line 64 in http://src.chromium.org/viewvc/chrome/trunk/tools/commit-queue/pending_manager.py
This is because revision can only be one of (None, int, unicode). This crash only happens when try jobs are used (which is why I did not see it before).
This CL changes the return type to be unicode instead of string.
Review URL: https://chromiumcodereview.appspot.com/25686005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@226743 0039d316-1c4b-4281-b951-d872f2087c98
svn commit likes to hang indefinitely whenever the svnserve server forgets
about the client. This changes ensures the commit queue won't be blocked by
this problem.
R=maruel@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/12440058
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@189382 0039d316-1c4b-4281-b951-d872f2087c98
This would cause a few exceptions on the CQ until it realizes the checkout is
not present anymore.
R=petermayo@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/11649011
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@173916 0039d316-1c4b-4281-b951-d872f2087c98
This causes an excepiton on Windows,
File "E:\b\depot_tools\subprocess2.py", line 341, in communicate
TypeError: Using timeout and shell simultaneously will cause a process leak
since the shell will be killed instead of the child process.
TBR=petermayo@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/11368148
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@166732 0039d316-1c4b-4281-b951-d872f2087c98
svn commit likes to hang indefinitely whenever the svnserve server forgets
about the client. This changes ensures the commit queue won't be blocked by
this problem.
Add --quiet to the git fetch command but do not capture anymore.
R=petermayo@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/11358165
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@166725 0039d316-1c4b-4281-b951-d872f2087c98
Stop using stderr so the output is more readable on buildbot.
Otherwise stderr arrives before stdout in apply_issue step.
TBR=rogerta@chromium.org
BUG=153284
Review URL: https://chromiumcodereview.appspot.com/11038002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@159508 0039d316-1c4b-4281-b951-d872f2087c98
Nobody cares about those .orig files and they get in the way on the try server
for some specific license check.
R=cmp@chromium.org
BUG=152507
Review URL: https://chromiumcodereview.appspot.com/10983092
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@159329 0039d316-1c4b-4281-b951-d872f2087c98
For an unknown reason, 'svn propset svn:executable * foo.sh' doesn't work on
Windows. It is even more awkward that 'svn propset svn:executable . foo.sh'
works just fine, in particular, subversion replaces the value, as long as it's
not an empty string, back to '*'.
R=petermayo@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/10967071
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@158281 0039d316-1c4b-4281-b951-d872f2087c98
_check_output_svn sets the cwd to project_path
therefore files should not have project_path.
R=maruel@chromium.org,cmp@chromium.org
BUG=149702
Review URL: https://chromiumcodereview.appspot.com/10909254
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@156953 0039d316-1c4b-4281-b951-d872f2087c98
It relied on a behavior that doesn't hold on python 2.7 anymore w.r.t. tuple
comparison to non-tuple objects.
Now be explicit about having source files to be first.
R=rogerta@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/10915240
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@156355 0039d316-1c4b-4281-b951-d872f2087c98
This permits to count the number of check-ins between two revisions. This will
be used by the CQ to determine if a try job 'expired', e.g. it is so old that it
can't be used anymore. The .revisions() function specifically count the number
of commits, instead of just doing arithmetic on the svn revision numbers.
R=cmp@chromium.org
BUG=
TEST=Manually:
import checkout
s = checkout.SvnCheckout('/path/to/chrome/src', None, None, None, 'svn://svn.chromium.org/chrome/trunk/src')
s.revisions(148323, 148330)
s.revisions(148323, None)
g = checkout.GitCheckout('.', None, 'master')
g.revisions('HEAD^^^^^^^^', None)
g.revisions('HEAD^^', 'HEAD')
Review URL: https://chromiumcodereview.appspot.com/10821011
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@148546 0039d316-1c4b-4281-b951-d872f2087c98
Add corresponding support to scm.SVN.Revert() to clobber the svn:ignore'd files.
This makes the commit queue remove all the unversioned files, which could have
improved its stability. It failed in practice to improve it but it's still a
good thing to do overall.
R=petermayo@chromium.org
BUG=
TEST=
Review URL: http://codereview.chromium.org/10355014
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@135333 0039d316-1c4b-4281-b951-d872f2087c98
The patches needs to by applied 'in-order' to not delete source files.
Added more tests.
R=dpranke@chromium.org
BUG=94330
TEST=
Review URL: http://codereview.chromium.org/8038056
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@103309 0039d316-1c4b-4281-b951-d872f2087c98