Commit Graph

333 Commits (5a2fefb9ebf89806b6b6a5aeead5dad5855fc476)

Author SHA1 Message Date
dpranke@chromium.org 330f534792 Although there appear to be one or two tests that are flaky on both mac and linux.
Review URL: http://codereview.chromium.org/6681019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77955 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 970c522f0f Make git-cl work with OWNERS file hooks properly.
This version calls into presubmit_support directly to support the OWNERS hooks. We do not need both this patch and http://codereview.chromium.org/6646009/

This patch depends on http://codereview.chromium.org/6665018/ .

Review URL: http://codereview.chromium.org/6674014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77898 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 627ea67f26 Actually check Rietveld for LGTMs ...
This change requires us to change the previous signature for the CheckOwners() hook to provide the server address and email regexp to use for parsing approvals from Rietveld.

Review URL: http://codereview.chromium.org/6657028

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77891 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org ff5a87adfb suppress messages for PresubmitAddText results
Review URL: http://codereview.chromium.org/6646040

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77700 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 3ae183fbb7 add PresubmitAddText() result class to indicate that text needs to be passed back to git cl / gcl.
Also, this properly wires up the presubmit code to the owners code and adds unit tests.

Review URL: http://codereview.chromium.org/6623074

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77523 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 86bbf19ccf Add more tests for owners.py, remove unneeded code, make syntax errors more helpful
Review URL: http://codereview.chromium.org/6639010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77522 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 7eea259694 use PEP-8 naming for method names in owners.py, tests/owners_unittest.py
Review URL: http://codereview.chromium.org/6646007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77521 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org f9040728dc Shorten RemoveDirectory and rename to rmtree. Remove rmtree from fake_repos.
Keep an alias to RemoveDirectory, will be removed in a later change.

TEST=new unit test to test this function
BUG=none

Review URL: http://codereview.chromium.org/6628032

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77463 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 924158a717 Add code to correctly revert a svn add'ed file.
Improve test to make sure svn status comes out clean.

TEST=improved unit tests and scm.SVN.Revert() should now do the right thing
BUG=none

Review URL: http://codereview.chromium.org/6650011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77391 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 6dada4eef1 make tests work, implement 'set noparent', owners propagating down
Review URL: http://codereview.chromium.org/6627059

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77351 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 7dfb9b747c Add trial_dir to manage automatic trial directory creation and deletion.
The tests now base the directory in mkdtemp() which is much safer than using the
source's file directory as before.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6625018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77278 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org ae43f83fe3 add owners_file() convenience constructor function for testing, make user names a bit more generic
Review URL: http://codereview.chromium.org/6632014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77178 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 3c08dd45cc Add some unit tests. They don't pass yet.
Review URL: http://codereview.chromium.org/6612011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76980 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 5257081dbf Remove FakeReposBase.HOST and add svn_base and git_base.
Ease support for different port if necessary.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6632007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76968 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org bd21c51d98 Correctly kill 'git daemon' child process, fixing a lot of testing issues.
Add code to wait for the bound port to open and close correctly, removing race
conditions.

BUG=test reliability
TEST=better

Review URL: http://codereview.chromium.org/6627013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76966 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 80277cf4e7 Clean gclient_smoketest import and call of super class.
BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6621013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76965 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org af45349294 Improve SVN.Revert() to catch more corner cases.
Add a unit test to catch potential regressions. Remove an old test new code broke.

TEST=unit tests
BUG=none

Review URL: http://codereview.chromium.org/6613025

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76805 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 2a00962421 Add first changes needed for OWNERS file support.
This changes adds the first pass of code needed for OWNERS files.
In total there should probably be maybe four user-visible changes:
  * new gcl/git-cl "suggest-reviewers" command
  * a presubmit hook on upload to automatically add the reviewers
  * an addition to gcl/git-cl status command that tells you
    which files still need review/approval.
  * a presubmit hook on commit to ensure all of the needed reviewers
    have approved the file.

This change implements a core "owners Database" object with the
dumbest possible algorithm for determining a covering set of reviewers,
and the skeleton of the presubmit hooks. This code will not be
used by anything yet, and is also missing unit tests.

Review URL: http://codereview.chromium.org/6581030

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76342 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 885d6e890f Fix scm.SVN.GetCheckoutRoot() so it is not confused by intermixed checkouts
from the same repository.

TEST=added regression test.
BUG=none

Review URL: http://codereview.chromium.org/6578029

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@75937 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 00fdcb3380 Fix bug introduced in r51121: gcl upload crashes on a 'revived' file.
To reproduce, svn delete a file, then svn merge -c -N the file to revive it.

Also fix a unit test that was broken for a while.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/6576005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@75835 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org ab05d582fa Modify presubmit checks to work on changed lines only.
Unittest is being also updated.

TEST=manual
. run ./presubmit_unittest.py, observe success
.create a CL with code style violations (long lines, traling spaces) and observe the violations reported by 'git cl presubmit'

Patch contributed by Vadim

Review URL: http://codereview.chromium.org/6461011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74378 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 7444c50483 Improve presubmit_support.py handling of git checkout.
It would fail otherwise when called directly from a git checkout subdirectory.

Updated unit test.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6459010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74281 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org cdbecc49e9 Improve tests to support more git versions and different outputs.
Disable warning W0404 in pylint.

BUG=none
TEST=should now work on googlers workstations

Review URL: http://codereview.chromium.org/6456010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74242 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 07ab60e26f Move reverting code from gclient_scm to scm to be able to reuse the code.
There is 2 changes while moving the code:
- Making externals handling an option.
- Not trapping EnvironmentError.

This code will be reused by the commit queue.

TEST=unit tests
BUG=none

Review URL: http://codereview.chromium.org/6250177

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74181 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
estade@chromium.org fdcc9f7f4c Add a presubmit test that asserts TODOs have owners.
For example, TODO(foo) is ok, but TODO: do something is not.

BUG=none
TEST=included

Review URL: http://codereview.chromium.org/6413004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74032 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 17f9e1f7dc Add comment to clarify SHOULD_LEAK
NO CODE CHANGE.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6349053

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@73510 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 26d762d0c0 Add code to FakeReposBase to revert changes committed by a unit tests.
This enables seamless unit tests that check-in files without side-effects on the
remaining unit tests.

BUG=none
TEST=none
TBR=dpranke

Review URL: http://codereview.chromium.org/6250073

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@73456 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 21548eb01b Change the fake repo svn users to be emails.
Also remove the harcoding of the names by putting them in a variable.

This will help testing of the commit queue.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6350013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@72454 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org ce117f6193 Add --ignore-externals to svn update and svn checkout invocations.
svn:externals are slow to update and are unnecessary in a gclient environment.

TEST=none
BUG=55904

Review URL: http://codereview.chromium.org/3421013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71604 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 4c6f18ca9e Silence pylint warnings.
TBR=dpranke
BUG=
TEST=

Review URL: http://codereview.chromium.org/6051004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69848 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org e0f81697e8 Split FakeRepos class in two so it can be reused for commti-queue unit tests.
FakeRepos is useful for offline SCM tests but it was hardcoded for depot_tools
requirements. Luckily, it was already modular enought that it merely required to
shuffle code around to split it in two classes to be able to reuse the code
as-is.

BUG=
TEST=

Review URL: http://codereview.chromium.org/6029004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69845 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org bf38a7ed53 Enhance RunPylint to use white_list and black_list arguments.
Change RunPylint to parse all .py files when one is modified.

Make all depot_tools/tests pass on pylint. That mostly meant fixing some
builtins aliasing, wrong alignment and turning off most remaining warnings.

BUG=none
TEST=unit tests

Review URL: http://codereview.chromium.org/5695007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69159 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org e94aedc26f Add RunPylint as a canned presubmit check.
Adding it as I figured out how to make it run correctly on ubuntu 10.4 and it's
used in enough places it warrants a canned check.

BUG=none
TEST=it self tests itself.

Review URL: http://codereview.chromium.org/5682011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69051 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 0661727bdc Reduce the chances for gclient to throw an exception in subprocess module.
Python standard library is not thread safe. Work around it by leaking a bit.
The problem is particularly visible on python 2.4.

TEST=none
BUG=60623

Review URL: http://codereview.chromium.org/4465001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@65048 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org cb2985fb69 Largely reduce the number of pylint warnings and fix one typo.
Most of them are style issues or variable aliasing.

TEST=Can almost enable pylint warnings
BUG=none

Review URL: http://codereview.chromium.org/4360002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64908 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 716268585a Make CheckLicense() to not trigger on empty files.
This is especially annoying on empty __init__.py files.

TEST=new unit test
BUG=none

Review URL: http://codereview.chromium.org/4310001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64904 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ed68d975d0 Blacklist more characters when sending a try job.
Otherwise files containing these characters can be created on the file system,
making it harder to get rid of those files.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/4127014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64782 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8e13a09439 Change gcl presubmit to only run commit hooks by default.
Upload hook are only run with the --upload flag.

Most of the time the same hook is run in both case so gcl presubmit is simply 2x
slower than it could be otherwise.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/4277003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64779 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org bf1fdca798 Add rietveld member to ChangeInfo and use this value to contact rietveld.
This makes gcl to use a specific rietveld instance per change list. This is
useful when moving from one rietveld instance to another, so in-flight reviews
are sent to the right instance.

Also clear gcl.CODEREVIEW_SETTINGS between gcl_unittest tests to remove tests interference.

TEST=updated unit tests
BUG=none

Review URL: http://codereview.chromium.org/4218006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64631 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org fa3843e6af Refactor ChangeInfo.Load() to make it easier to support mulitple format.
TEST=updated unit tests and tested manually
BUG=none

Review URL: http://codereview.chromium.org/4127013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64601 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 463042941a Fix custom_deps, hooks and custom_vars to be evaluated even if no DEPS file.
Previously, solution's properties would be ignored if there was no DEPS file in
source control. Change the behavior to evaluate the properties anyway.

TEST=new smoke test
BUG=none

Review URL: http://codereview.chromium.org/4154004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64232 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org d5766bb0ce Add a new regression test for custom_deps in .gclient files.
To make sure to regression is added while looking into the code more deeply.

BUG=none
TEST=new smoke test

Review URL: http://codereview.chromium.org/4215001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64230 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 78b8cd14ef gclient can now handle git URLs containing "-" in usernames and "~" in paths.
Contributed by Torsten Becker <torsten.becker@gmail.com>

BUG=
TEST=gclient config 'ssh://user-name@asd.com/~/asd.git' && gclient sync  # fails in SplitUrlRevision

Review URL: http://codereview.chromium.org/4144002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@63877 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ac61023c2c Fix a bug in gclient recurse for git-svn users. Make gclient_utils.CheckCall more versatile.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/3737001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@62400 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
bauerb@chromium.org 4acf742e90 Fall back to our own codereview settings if a key is not found in gcl's settings.
Otherwise, git try breaks for some users.

Also, make testUpdateCheckout pass if the path to the temp directory contains a symlink (like on Mac OS X).

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3620011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61786 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
joi@chromium.org 42c7f66733 Reuse gcl.py's code review settings when running [gcl try], as gcl is
smarter about finding the most appropriate settings file.

Before this change, I inadvertently did a [gcl try] on a chrome-internal
change (it was a trivial change and not really secret, so no harm done).
After this change, that won't be possible.

Also, change breakpad to not upload the exception that is thrown when 
the user fails to provide correct log-on credentials.

TEST=none
BUG=none


Review URL: http://codereview.chromium.org/3390013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61738 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 795a8c1d0a Fix gclient_scm_test that was broken in r61459.
Added a unit test to verify .hg detection.
Also refactor the test a bit to reduce the amount of reduncdant code.

TEST=fixed unit tests
BUG=none

Review URL: http://codereview.chromium.org/3516015

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61551 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8d19523063 Add a note warning the users that presubmit hooks will be run.
Otherwise the scripts make it looks like they are hung when the presubmit checks
are slow.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/3613007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61506 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 77e4ecaf59 Remove cruft from having to do bookeeping of options.stdout.
This makes the code saner to understand.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/3420014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@60050 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 8071c2879c Remove unneeded parameter.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/3473004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59965 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago