Commit Graph

142 Commits (3d36e795318ca7d07bbe74fb7e170c85da326290)

Author SHA1 Message Date
kjellander@chromium.org 3cc75307e9 Fix toplevel_root parsing in trychange.py
In https://codereview.chromium.org/11574007/ I attempted to make it possible to use the TRYSERVER_ROOT setting in codereview.settings. It seems like some checkouts ran into errors with it not finding the codereview.settings file when it was parsed. This is probably due to the fact that the following call chain reads the self.toplevel_root variable:
_GclStyleSettings -> GetCodeReviewSetting -> ReadRootFile
By moving _GclStyleSettings up before self.toplevel_root is set probably causes this.

This CL attempts to correct this.

BUG=none, but try job upload fails for some users.
TEST=submitting try job to locally running try server.


Review URL: https://chromiumcodereview.appspot.com/11571052

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@173928 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
kjellander@chromium.org e6ce537fdc Move parsing of TRYSERVER_* so options.root is not overwritten
Since the helper function for the parsing of the TRYSERVER_* variables relies on them being unset (i.e. value is None) in order to apply the settings from codereview.settings, this parsing must take place before the code that figures out the root path (since that sets the options.root value if it's not set). 
Otherwise the TRYSERVER_ROOT setting will never be set, even if configured in codereview.settings, essentially making it useless.

This has probably not been discovered previously since almost all Chrome projects use src as the root dir. In WebRTC and some other projects we use 'trunk' usually, which is giving us trouble in our own try server  setups (where we have to use 'src' because many other scripts have that root dir hardcoded).

I am not sure if there is a case for another project where this change may have any negative effect. Please let me know if theres's any investigation needed that I can assist with.

BUG=none
TEST=submitting try job to local try master with a codereview.settings file with TRYSERVER_ROOT set.

Review URL: https://chromiumcodereview.appspot.com/11574007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@173694 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
hinoka@chromium.org 791be0bc65 Added extra error message to trychange for empty diffs
BUG=


Review URL: https://chromiumcodereview.appspot.com/11046004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@159765 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
ilevy@chromium.org f3b2123a71 Disable jobs sent directly to triggered bots
- and display a warning message

BUG=146713


Review URL: https://chromiumcodereview.appspot.com/10956062

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@158377 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
sbc@chromium.org 495ad15721 Add --force option for presubmit command which
allows one to run the presubmit script without
submitting locally (alternative would be to make 
this a warning I guess).

Also, pass option.verbose through to DoGetTrySlaves()
so it will log which PRESUBMIT files are taking part
in the decision.

BUG=

Review URL: https://chromiumcodereview.appspot.com/10915072

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@154838 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
gavinp@chromium.org affe7b8148 Make git try warn on a dirty index.
Many, many times this has burned me badly; if you have a dirty index,
git try will just upload your commits, and not the index.

R=nsylvain@chromium.org
BUG=None

Review URL: https://chromiumcodereview.appspot.com/10836180

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@151202 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 46b9fee990 gclient_utils.FileWrite() assumes text data but trychange doesn't.
Use manual file writing, it's just two lines.

TBR=nsylvain@chromium.org
BUG=
TEST=git try works with non-ascii patches


Review URL: https://chromiumcodereview.appspot.com/10815009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@147447 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 4f6852cca4 Remove python 2.5 compatibility code.
R=cmp@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@133265 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 3ecc8ea477 Adds saner behavior for git try -t foo to not fail in a inexplicable way.
Enforces that each builder and builder:test association must be in its own list item in PRESUBMIT.py/GetPreferredTrySlaves().

If a user run git try -t foo, trychange.py will now take the list of all the
slaves, will skip any :compile builder, and apply the test filter to them.

Currently, git try -t foo on a chromium checkout throws an exception because of
PRESUBMIT.py files containing test specification.

R=petermayo@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@125975 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 9eef4f27d0 Fix support for --bot bot1,bot2 -t foo
Previously, it would apply the test filter only on the last bot.

TBR=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@125622 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org dd44794218 Stop sending the testfilter= flag to the try server and process it locally.
The previous behavior would cause inproper parsing;
- the bot=bot1 flag would add 'bot1': ['defaulttests'] to the dictionary.
- the testfilter=test1 flag would append 'test1' to the list, causing the value
  to look like 'bot1': ['defaulttests', 'test1'].

I think on the long run the best is to keep --testfilter as a user interface but
not on the try server. This effectively stops sending testfilter=foo to the
server.

Add unit test to verify it's working properly. Refactor a bit to make unit
testing simpler.

R=petermayo@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@125405 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org e83dda0510 Improve trychange.py documentation. No logic change
R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@123301 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org a4155cb539 Change the way trychange.py sends the try jobs.
Now accepts duplicate keys, it simplifies parsing, like when multiple bots are
used, each with their own test filter. This enables full test specification per builder.

R=petermayo@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@121842 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
jrg@chromium.org 3b871cb760 --print_bots arg to 'gcl try' for debugging PRESUBMIT.py changes.
Prints the bots a tryjob would use if sent out.
(Does not send out the job.)

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@121409 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
dgrogan@chromium.org 95406ac958 trychange.py: make --sub_rep work again
It appears to have been broken in http://crrev.com/104148

BUG=102205

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@116723 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 80a9ef1e12 Enforce cwd for GIT functions
GIT.CaptureStatus was assuming os.getcwd() was using all the time, which isn't
true when using trychange.py --sub_rep XXX.

R=dpranke@chromium.org
TEST=
BUG=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@114264 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org d579fcf951 Enforces using cwd in all svn calls.
That helps weed out some issues faces with svn plus helped me figure out some
misuses.

Most of the commands have been implicitly depending on os.getcwd(). This change
makes it always consistent and clear when dependence on the current directory is
needed.

Remove default arguments to scm.SVN.GenerateDiff and a few other calls to be
sure the refactoring was done right.

R=dpranke@chromium.org
BUG=
TEST=make sure most commands aren't broke


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@114262 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 4159b736a1 Still send try job status even if test filter is used
This caused all CQ job to not show up on rietveld. Now that rietvelt supports
multiple try job per builder per patchset, this check is not useful anymore.

TBR=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@113952 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
supersat@chromium.org 56f4c47459 Reverted accidental commit
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@112766 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
supersat@chromium.org e8043d11af Fix pulling in patches from git subrepos
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@112765 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 67ec5fae41 Fix automatic detection when git is not installed
subprocess2.check_output() raises an OSError instead of a CalledProcessError
when the executable is not found.

R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@109325 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
rcui@google.com 13595ffa41 Add repo-managed checkout support to trychange.py
BUG=chromium-os:21286
TEST=Ran 'git-try' with/without --root=src, and with/without .gclient file

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@105229 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org eba9b7fc02 Add a safeguard because I always use -p 8000 by error when I mean --port 8000.
R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@105226 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 36c8b94904 Enforce port being a number
R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@104780 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
asvitkine@chromium.org d32fab24a6 Fix git --upstream_branch breakage due to removal of |file_list| param.
Makes SCM take the |file_list| as a parameter instead of getting it from |options|.

BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@104148 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
asvitkine@chromium.org 2896eda9ae Remove |file_list| parameter from |TryChange()|.
BUG=none
TEST=Run unit tests - they should still pass. Run gcl try and git try and make sure there are no errors.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@104067 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
asvitkine@chromium.org f4eaacbcc3 Convert Windows to POSIX path when calling scm.GIT.CaptureStatus().
Fixes problem in this thread:

http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/6098b2d0136e650e#

This was broken by http://crrev.com/102930, when I made GIT's GenerateDiff() use scm.GIT.CaptureStatus() instead of scm.GIT.GetDifferentFiles().

(Thanks Scott Graham for figuring out the problem!)

BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@103302 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
asvitkine@chromium.org 57dd5754e7 Extract filenames from diffs better.
This is a followup to: http://codereview.chromium.org/8059009/

Only add the file once instead of twice (since the diff has --- and +++ lines for each file).
Strip whitespace at the end (git diffs don't include a \t so split('\t') isn't enough).
Remove leading 'a/' from the path, since git diffs have these.

BUG=none
TEST=manual

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@102934 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
asvitkine@chromium.org 1516995e79 Support for |change| argument to |GetPreferredTrySlaves()|, try 2.
Needed to make it so changes containing only *.mm are only sent to Mac trybots by default.

BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@102930 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 6fb14d906b Revert r102783 "Support for |change| argument to |GetPreferredTrySlaves()|."
Cause an infinite recursion in some context.

TBR=asvitkine@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@102836 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
asvitkine@chromium.org c0c424bca4 Support for |change| argument to |GetPreferredTrySlaves()|.
Needed to make it so changes containing only *.mm are only sent to Mac trybots by default.

BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@102783 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
craig.schlenter@chromium.org 0e863f9078 Allow a trailing slash in the rietveld url.
Review URL: http://codereview.chromium.org/7894003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@101356 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 69bc538f97 subprocess2.check_output() doesn't allow stdout, like python2.7's version.
Don't bother, but redirect stderr.

TBR=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100464 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 6a05169568 Use check_call(), not check_output()
There is user interaction when the svn credential isn't cached. (Duh)

TBR=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100462 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org e3606abc5a Fix check_output usage in trychange.py
Update the command for subprocess.CalledProcessError

TBR=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100410 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 13c271b712 Remove usage of gclient_utils.CheckCall() from trychange.py
I'd like to eventually remove this function.

TBR=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100169 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bradnelson@google.com 78230020bb Allowing project name to be used to select groups of bots.
BUG=79546
TEST=None
Review URL: http://codereview.chromium.org/7063004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@86460 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 31cb48a436 First pass to transition away for gclient_utils.Error and gclient_utils.CheckedCallError.
Make sure every site that catches gclient_utils.Error also catch
subprocess2.CalledProcessError.

BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80339 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 725f1c3b69 Add a warning if the current version of python is not 2.5
R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80212 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 35625c7e56 Fix locale.getlocale() exception.
Reapply r79006 with fixes for ubuntu 10.4.

The only change is in fix_default_encoding() to trap an exception
locale.getlocale() may throw.

R=dpranke@chromium.org
BUG=none
TEST=unit test

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79144 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org f946b22f96 Revert r79006: "Add code to 'fix' python encoding and it's unit test."
It is causing exception for some users on ubuntu 10.4 with:
"category LC_ALL is not supported"

TBR=dpranke

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79012 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 8e741d3bb1 Add code to 'fix' python encoding and it's unit test.
With this code in action, I can successfully print arabic and chinese on linux
and cygwin. It fails to print chinese on my Mac but prints arabic. It prints '?'
on Windows console but it *doesn't throw* which is the biggest improvement here.
It was particularly a problem on windows because WindowsError's description text
is in the current ANSI code page so it failed to print if the text was not pure
ASCII, like error message when using Windows' French UI.

R=dpranke@chromium.org
BUG=none
TEST=manual unit test ./tests/fix_encoding_test.py and it shouldn't throw

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79006 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bauerb@chromium.org d3e5754b26 Reland 77470: Don't ignore first argument in TryChange
Original review: http://codereview.chromium.org/6650025/

BUG=none
TEST=`git try foo` gives a proper error message.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78180 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org d945f368d2 suppress some unimportant lint warnings
Review URL: http://codereview.chromium.org/6658013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77882 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bauerb@chromium.org b88c38bc4b Revert "Don't ignore first argument in TryChange."
This reverts commit 39d5bf3d5f.

TBR=maruel

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77475 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bauerb@chromium.org 39d5bf3d5f Don't ignore first argument in TryChange.
BUG=none
TEST=`git try foo` gives a proper error message.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77470 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
thakis@chromium.org 3487f7f45f Add more logging. Useful to understand `git try` slowness.
Review URL: http://codereview.chromium.org/6247008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71602 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org fca5339456 Workaround the fact that pylint calls sys.exit().
Otherwise the following presubmit checks where never called.

TBR=nsylvain
BUG=
TEST=fixes unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69844 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@google.com 2e9ba2ac6b Add support for an --upstream_branch argument to make diffing against
things other than trunk easier.

    BUG=none
    R=maruel@chromium.org
    TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69307 0039d316-1c4b-4281-b951-d872f2087c98
14 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