Commit Graph

47 Commits (b9e7adaa828ffc8c38fb37af2e086b01c88a9373)

Author SHA1 Message Date
maruel@chromium.org 5aeb7dd54c Reapply 32057, 32058, 32059, 32062 and fixes problems introduced by these changes.
Noteworthy change is scm.SVN.GetFileProperty calls Capture instead of Run.

TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32181 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 261eeb5e93 Revert 32057, 32058, 32059, 32062 because they still have unwanted side-effects.
Revert "Group SCM-specific functions in classes to simplify generalization of the interface."
Revert "Fix 2 recently introduced errors."
Revert "Fix a variable aliasing error."
Revert "Fix typo."

TBR=dpranke
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32065 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 85a3192f9c Group SCM-specific functions in classes to simplify generalization of the interface.
TEST=none
BUG=none

Move scm functions into a class to make it simpler to manage.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32057 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org e3608dfc1a Run pychecker over most scripts in depot_tools. Catched a few bugs.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31590 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
gspencer@google.com efb9450e27 This makes presubmit queries accept "yes" as well as "y"
as an answer.
Review URL: http://codereview.chromium.org/268023

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28557 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
thestig@chromium.org de24345ee7 Make the try slave selection client side.
BUG=23071
TEST=none
Review URL: http://codereview.chromium.org/248029

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28155 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
chase@chromium.org 8e416c83a8 Git support in presubmit tests.
Expand presubmit_support and gclient_scm to support
getting basic status and changed files from a Git
checkout.

BUG=5339
TEST=presubmit_support.py works from a git checkout,
gcl presubmit works from a svn checkout
Review URL: http://codereview.chromium.org/242140

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28092 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 5f3eee3bab gclient: remove wildcard import from git_scm
Part of a larger refactoring to abstract SCM-specific bits.

presubmit_support, revert, gcl: modify to import gclient_scm and gclient_utils

Part of a larger refactoring to abstract SCM-specific bits.

revert, gcl: modify to import gclient_scm and gclient_utils

Part of a larger refactoring to abstract SCM-specific bits.

gclient: pull out SCM bits

Pulled out SCMWrapper into gcliet_scm.py as part of a larger refactoring to
abstract SCM-specific bits. Plan is to evenutally add git support.

Pulling out SCMWrapper also required pulling out utility functions into
a gclient_utility.py.

Patch contributed by msb@

TEST=none
BUG=none


git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@26423 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
pam@chromium.org ed9a083365 Report computation time before showing a prompt, so the response time
isn't included in the calculation.

BUG=none
TEST=submit change with presubmit warning, note reported time

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@25806 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
thestig@chromium.org 6bd3170a1a Change directory to repository root before running CheckSvnModifiedDirectories.
Review URL: http://codereview.chromium.org/191002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@25270 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org d59982a1c6 Treat .txt files as 'source' files (to enforce LF and line length)
Review URL: http://codereview.chromium.org/174210


git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@24100 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
jam@chromium.org 2a891dc893 Print out how long presubmit checks took if it's more than 1 second.
Review URL: http://codereview.chromium.org/174163

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@23870 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
thestig@chromium.org da8cddddfe Add a presubmit check for accidental checkins of files under a SVN modified directory.
Review URL: http://codereview.chromium.org/155489

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@23271 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org ce8e46b3b2 Ask for feedback one time out of 5, only when there is presubmit check notification.
TEST=unit test
BUG=none
Review URL: http://codereview.chromium.org/147162

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@19429 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org c0b2297c8a Change RunPythonUnitTests() to run the unit tests in a separate process.
The unit tests could modify global state in hard-to-revert ways and would make the PRESUBMIT.py check flaky.
Having the test running out of process alleviate any potential issue at the cost of speed (more noticeable on Windows).

TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@19248 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org c70a220f72 Add partial presubmit support to git checkout.
Also fix argument processing.

It doesn't works at the moment but doesn't throw an exception either. :)

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18611 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 4ff922af46 Remove gcl.ChangeInfo dependency in presubmit_support.py.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18309 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 8d5c9a5a52 Fix gcl breakage.
Small refactor of ChangeInfo to not hardcode the use of GetRepositoryRoot().

TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18272 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 17f59f2dd9 A step closer to make presubmit SCM independent.
Stop presubmit_support.py from calling gcl.GetRepositoryRoot(). Instead, save the repository root in ChangeInfo and name it GetLocalRoot() to make it less confusing.
Add GetFileList() and GetFileNames() to ChangeInfo to make it less confusing and more "interface-like".

TEST=updated unit tests with a lot of pain
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18266 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 07bbc21467 Actually make use of the may_prompt flag.
This is annoying when using gcl presubmit.

TEST=unit test
BUG=none
Review URL: http://codereview.chromium.org/122010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18141 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org df1595ac20 Fix the ALL_CAPS black list regexp.
Add some regexp unit test.

TEST=unit test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18139 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 92022ec600 Melting pot of changes.
Fix GclChangeInfo.__getattr__ to only accept uppercase tags.
Rename illnamed GclChangeInfo.Change() to GclChangeInfo.Name().
Fix random comments.

TEST=unit test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18138 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 196f8cbabb svn always add a \n at the end of the output.
It's better to strip it off.

TEST=none
BUG=none
TBR=nsylvain

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18123 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 5de1397a35 Make AffectedFile usable as items.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18076 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org b0dfd35742 Make the presubmit output much more compact.
Disable prompting when using gcl presubmit xxx.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18054 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org b7d469083f Add CheckChangeSvnEolStyle presubmit canned check.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18053 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 3410d917f3 Add InputApi.AffectedSourceFile() and custom filtering support.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17975 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 44a17adf95 Add InputApi.ReadFile() and presubmit_canned_checks.CheckChangeHasNoCR().
ReadFile limits to reading files inside the repository.
CheckChangeHasNoCR reads the text files looking for \r and fails if found.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17857 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org de0ba297d9 Fix presubmit_support.py run standalone and RunPythonUnitTests
TEST=none
BUG=none
TBR=joi

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17839 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org d7dccf5614 Add InputApi.is_committing to be able to return a failure or notification, depending on the check.
Add input_api.traceback, useful for dumping information.

BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17837 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 32ba260f1e Added patchset persistence in gcl, this is necessary to implement a presubmit queue.
Now enforces ChangeInfo.issue (and .patchset) to be a int.
Renamed LoadChangelistInfo() to ChangeInfo.Load().
Removed ChangeInfo.__init__() default parameters.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17836 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 1487d53b6c Improve the presubmit_canned_checks testing by using a real mock and testing for more cases.
Remove a superfluous check in CheckLongLines().

Add unittest to InputApi.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17805 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 4661e0c77b The broken PRESUBMIT.py was fixed so reintegrating revision 17554 (which was good in the first place).
BUG=none
TEST=none
TBR=joi
Review URL: http://codereview.chromium.org/119130

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17578 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 0018e7313d Seems like revision 17554 busted the presubmit scripts, reverting.
TEST=None
BUG=None
TBR=joi
Review URL: http://codereview.chromium.org/119122

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17561 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 8b40a9b81b Fix ListRelevantPresubmitFiles().
It was affected by the current directory!

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17554 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 77c4f0f135 Remove SVN-specific function InputApi.FilterTextFiles().
Review URL: http://codereview.chromium.org/115923

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17202 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 15bdffa063 Make AffectedFile member variables private.
Cache SvnAffectedFile.IsTextFile() return value.

Improve the unit test by not/less relying on the local file system.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17180 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 1e08c00d60 Add AffectedFile.IsTextFile() and deprecate AffectedTextFiles().
Make DepotToLocalPath() and LocalToDepotPath() not static. It is necessary for a subsequent change since I need to factor out it's SCM assumption.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17091 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 6ebe68a73d Make the member variable 'protected' in the python sense.
Review URL: http://codereview.chromium.org/113899

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17039 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org e1a524ff00 Remove SPECIAL_KEYS and GclChange.Changelist() to simplify the code.
Review URL: http://codereview.chromium.org/113883

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16983 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org f3eee5692c Add a unit test for input_api.change.tags.
Review URL: http://codereview.chromium.org/113859

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16959 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 9711bbafde Add InputApi.version so the presubmit script can mark a minimum supported version for instance.
BUG=None
R=joi

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16819 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org dbbeedc691 Factor out SVN-specific methods out of AffectedFile.
TEST=New unit tests.
BUG=None

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16785 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 73e36ed387 Fix AffectedFile.IsDirectory() to use the right path.
BUG=gcl commit doesn't show any "svn: 'bleh' is not a working copy" error
R=jam

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16781 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 0ff1fab804 Add repository root presubmit support.
Review URL: http://codereview.chromium.org/115616

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16738 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 3d23524cb0 Add more presubmit support. Add PRESUBMIT.py to depot_tools.
Changed InputApi.PresubmitLocalPath() to contain the absolute path without the script name.
Review URL: http://codereview.chromium.org/113354

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16157 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 1033accb23 Rename presubmit.py to presubmit_support.py to reduce confusion and be able to add a PRESUBMIT.py check into depot_tools.
Review URL: http://codereview.chromium.org/113337

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