Don't check bucket permissions if --no-auth.

Checking bucket permissions takes ~400ms. We don't
need to do this if --no-auth because we know we
won't get a 403 and the 404 check will be handled
later when we try to actually download the file.

Also, remove the check for a null bucket. This
can't happen since we will throw a parser error
in the main function before we get to this code.

R=iannucci@chromium.org

Review URL: https://codereview.chromium.org/772203002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293250 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Make --output and --sha1_filename work well together.

--sha1_filename unnecessarily forces the output to have
the same filename and be in the same directory. The code
in main already correctly sets the file name to the
sha1_filename minus the .sha1, so the only change is
to actually use the --output path the same way the
rest of the code does.

R=iannucci@chromium.org

Review URL: https://codereview.chromium.org/752803003

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293251 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fix download_from_google_storage.py.

check_bucket_permissions() takes exactly 2 arguments (3 given)

TBR=vadimsh@chromium.org

Review URL: https://codereview.chromium.org/780113003

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293254 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fixed download_from_google_storage for real.

check_bucket_permissions should no longer return a tuple.

TBR=vadimsh@chromium.org

Review URL: https://codereview.chromium.org/759013007

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293255 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fix upload_to_google_storage.py.

r293250 broke it. I didn't realize that check_bucket_permissions
was shared code. It now only returns a single value.

TBR=vadimsh@chromium.org

Review URL: https://codereview.chromium.org/782643002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293256 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Update upload.py in depot_tools to infra.git@3d174a0959ba68a4cd83a5abce9f497e30bfce68

Includes fix for bug 388937.

R=agable@chromium.org, jrobbins@chromium.org, maruel@chromium.org
BUG=388937

Review URL: https://codereview.chromium.org/785433003

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293259 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add canned presubmit check for GN formatting

Requires https://codereview.chromium.org/779883002/ to be landed/rolled before it's useful.

R=dpranke@chromium.org
BUG=348474

Review URL: https://codereview.chromium.org/779513005

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293269 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fix git-cl-dcommit hook tests.

TBR=agable@chromium.org, jrobbins@chromium.org, maruel@chromium.org
BUG=

Review URL: https://codereview.chromium.org/726673008

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293275 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Update cpplint.py to r141.

This just a copy of cpplint.py from upstream [1].

[1] https://code.google.com/p/google-styleguide/source/detail?spec=svn141&r=141

The change in gclient_scm.py is to address a presubmit check error
which was introduced by https://codereview.chromium.org/227163002
"print_func" parameter was being passed to a function instead of
the object constructor.

BUG=None
NOTRY=True

Change-Id: I4dca890d5f02957ddae33c4bd4269fd37758be3d

Review URL: https://codereview.chromium.org/777533005

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293276 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fail noisily when git auto-svn can't authenticate.

R=agable@chromium.org
BUG=N/A

Review URL: https://codereview.chromium.org/707233002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293277 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add fetch recipe for Skia's Buildbot repository.

Tested with the following command lines:

$ cd
$ mkdir skia_test
$ cd skia_test
$ fetch skia_buildbot
$ cd skia_buildbot
 # confirm the repo is what one would expect.

BUG=None
TEST=see above
R=agable@chromium.org

Review URL: https://codereview.chromium.org/777513002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293283 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Let `git cl format` format java files, too.

This will only have an effect if one's buildtools checkout is new enough, since
only then:

a) clang-format will be new enough to do a decent job for java files
b) clang-format-diff.py will be new enough to look at java files

So for older buildtools checkouts, `git cl format` will continue to ignore java
files.  For newer buildtools checkouts (like the one pulled by `gclient sync`
with a recent chromium checkout), it'll work and do a fairly decent job.

BUG=429372

Review URL: https://codereview.chromium.org/788933003

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293312 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
GSUtil.py wrapper script

This is for transitioning us out of the horribly outdated gsutil 3.4 thats
currently residing in depot_tools.  This script:
1. Downloads GSUtil, pinned to a version (4.6 by default).
2. Executes GSUtil with the given parameters
3. (TODO) Runs the fallback GSUtil if #2 fails.


The transition plan is:
1. Set the fallback as default, making this script a no-op
2. Modify recipes (main consumer of gsutil) to pass in --force_version 4.6
3. Switch 4.6 as the default for gsutil.py
4. Make fallback failure a loud red failure
5. Remove depot_tools/third_party/gsutil

BUG=434422

Review URL: https://codereview.chromium.org/742173002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293320 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Make gclient ready for the Blink (DEPS to main project) transition

This CL makes gclient understand correctly whether a git project is
being moved from DEPS to an upper project and vice-versa.
The driving use case for this is the upcoming Blink merge, where
third_party/Webkit will be removed from DEPS (and .gitignore) and will 
become part of the main project.

At present state, gclient leaves the .git folder around when a project
is removed from DEPS, and that causes many problems. 

Furthermore this CL solves the performance problem of bisecting across
the merge point. The subproject's (Blink) .git/ folder is moved to a
backup location (in the main checkout root) and is restored when moving
backwards, avoiding a re-fetch when bisecting across the merge point. 

BUG=431469

Review URL: https://codereview.chromium.org/743083002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293329 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
depot_tools: Send the remote tracked ref to Rietveld via upload.py.

This change goes hand in hand with the corresponding Rietveld change here:
https://codereview.chromium.org/773083004/
The motivation for both CLs came from the discussion in the internal CL: https://chromereviews.googleplex.com/115567013/

AFAIK either change can be submitted first without breaking anything in the other framework.

Observe the "Tracked Ref" field in the below CLs-

Tracking a remote ref:
* https://skia-codereview-staging.appspot.com/8861001 (Tracking skiabot-test's refs/heads/master)
* https://skia-codereview-staging.appspot.com/851002 (Tracking skiabot-test's refs/diff/test1)
* https://skia-codereview-staging.appspot.com/2891001 (Tracking Chromium's refs/heads/master)
* https://skia-codereview-staging.appspot.com/1931003 (Tracking Chromium's refs/branch-heads/1916)

Tracking a local branch which in turn tracks a remote ref:
* https://skia-codereview-staging.appspot.com/3891002 (Transitively tracking skiabot-test's refs/heads/master)
* https://skia-codereview-staging.appspot.com/4921001 (Transitively tracking Chromium's refs/branch-heads/1916)

CL when no target_ref is specified in depot_tools/third_party/upload.py:
* https://skia-codereview-staging.appspot.com/3871003 (CL with missing target_ref should default to /refs/heads/master)


Try the above links with and without the 'Deprecated UI' checked in https://skia-codereview-staging.appspot.com/settings


BUG=435702

Review URL: https://codereview.chromium.org/781523002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293334 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Avoid =~ since msysgit bash doesn't support it.

This uses grep instead.  Note that just grepping for "--force" matches other
things, e.g. "foo--force--foo", but that's a problem with the original code as
well, I think.

BUG=435729
TEST=Run gclient under msysgit bash.  No error should occur.

Review URL: https://codereview.chromium.org/789353002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293340 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fix test failures on Ubuntu/Trusty.

I ran into several failures running the presubmit checks
on my Ubuntu/Trusty laptop and it looks like a some of
the tests were broken by recent versions of svn and git.

Review URL: https://codereview.chromium.org/795723003

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293341 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Improve default email address for my_reviews.py

Also, fix assertion that fires if all the reviews are
on the same day (first_day == last_day)

Also, don't print backtrace if no arguments at all are
specified.

Review URL: https://codereview.chromium.org/797523002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293351 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Revert of Make gclient ready for the Blink (DEPS to main project) transition (patchset #6 id:180001 of https://codereview.chromium.org/743083002/)

Reason for revert:
The test intoruced is flake (see crrev.com/753543006/).
Need to look into that with more patience as it reproduces only on precise.


Original issue's description:
> Make gclient ready for the Blink (DEPS to main project) transition
> 
> This CL makes gclient understand correctly whether a git project is
> being moved from DEPS to an upper project and vice-versa.
> The driving use case for this is the upcoming Blink merge, where
> third_party/Webkit will be removed from DEPS (and .gitignore) and will 
> become part of the main project.
> 
> At present state, gclient leaves the .git folder around when a project
> is removed from DEPS, and that causes many problems. 
> 
> Furthermore this CL solves the performance problem of bisecting across
> the merge point. The subproject's (Blink) .git/ folder is moved to a
> backup location (in the main checkout root) and is restored when moving
> backwards, avoiding a re-fetch when bisecting across the merge point. 
> 
> BUG=431469
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=293329

TBR=iannucci@chromium.org,maruel@chromium.org,jochen@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=431469

Review URL: https://codereview.chromium.org/796053002

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293352 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
pylint: upgrade to 1.4.0

This is largely a bugfix release, so should be much easier to transition.

BUG=chromium:431514
TEST=ran on some code bases and checked output

Review URL: https://codereview.chromium.org/753543006

git-svn-id: http://src.chromium.org/chrome/trunk/tools/depot_tools@293355 4ff67af0-8c30-449e-8e8b-ad334ec8d88c