Commit Graph

38 Commits (9d9310c7ae525a2b7d77c6b35158740b63d781f7)

Author SHA1 Message Date
rmistry@google.com bb050f61d4 Make checkout.GitCheckout usable from apply_issue
BUG=chromium:303433

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@226774 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
rmistry@google.com 11145db693 Return unicode commit hashes in checkout.GitCheckout.
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
12 years ago
rmistry@google.com 3b5efdf64d Completing implementation of GitCheckout in depot_tools.
Tested with:
* Unit tests have been added and they work.
* I also tested end-to-end using a skiabot-test repository in https://skia.googlesource.com/ (it is hidden). CLs I tested with are:
** https://codereview.chromium.org/22797006/ : Add whitespace in file1
** https://codereview.chromium.org/22815013/ : Remove whitespace from file1
** https://codereview.chromium.org/22867025/ : Add new files in directories
** https://codereview.chromium.org/22901018/ : Edit file in directory and delete file in directory
** https://codereview.chromium.org/22918014/ : Add, Delete and Modify 3 files
** https://codereview.chromium.org/23360004/ : Add new files in new directories


Note:
* When committing GitCheckout uses the --author to specify the original author. The author flag takes in 'Firstname Lastname <email_addr>' but we do not know the Firstname and LastName of the original author, which is why the code here parses out the username from the email address and uses it.
  Eg: For email address xyz@example.com it passes in --author 'xyz <xyz@example.com>'
* An example of the changes required in a project to use GitCheckout instead of SvnCheckout is in https://codereview.chromium.org/22859063/


Created to fix the following feature requests-
https://code.google.com/p/chromium/issues/detail?id=261619 : Update the Chrome commit queue to push to src.git.
https://code.google.com/p/skia/issues/detail?id=1593 : Add Git support to the Commit Queue.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@221392 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
groby@chromium.org 2327994797 Create a temporary dir for patch to do its work.
BUG=259665

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@211443 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
csharp@chromium.org 9af0a1109f Enforce 15 minutes timeout for all operations and 30 minutes for checkouts.
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
12 years ago
maruel@chromium.org 6e904b4761 Add workaround where SVN.Revert() deletes the checkout.
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
12 years ago
maruel@chromium.org 44b21b9d86 Revert r166725 "Enforce 15 minutes timeout for all operations and 30 minutes..."
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
12 years ago
maruel@chromium.org 83273549f5 Enforce 15 minutes timeout for all operations and 30 minutes for checkouts.
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
12 years ago
maruel@chromium.org cb5667aaa2 patch can be None in the exception, causing a secondary exception.
R=csharp@chromium.org
BUG=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@163646 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 0aca0f9684 Enforce the checkout object to use an absolute path.
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
13 years ago
maruel@chromium.org 4dd9f7205a Make apply_issue.py much more verbose about what it's doing.
It's to help users figuring out what is happening.

TBR=rogerta@chromium.org
BUG=153284


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@159504 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org ec4a918139 Add --no-backup-if-mismatch so no .orig file is created when fuzzing occurs.
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
13 years ago
maruel@chromium.org e1a0376aa1 Fix applying svn:executable on Windows.
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
13 years ago
ilevy@chromium.org b0f852f372 Fix svn copies for apply_issue
_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
13 years ago
maruel@chromium.org de800ff7b0 Fix the patch application sorting.
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
13 years ago
maruel@chromium.org d7ca616cf1 Enable support to remove the executable bit on the CQ.
R=petermayo@chromium.org
BUG=124817


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@153908 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org bc32ad17e6 Add .revisions() implementation to *Checkout classes.
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
13 years ago
maruel@chromium.org 995f8ac254 Remove GitSvn*Checkout implementations.
They were not used, causing unnecessary code bloat.

R=cmp@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@148541 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 34f6855218 Improve error message in patch application failure.
Make exception PatchApplicationFailed() self printable.

R=cmp@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@136091 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 3da8317843 Implement proper svn copy when a file is copied, moved or renamed
R=nsylvain@chromium.org
BUG=
TEST=A basic unit test verifies history is kept

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@135651 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org ea15cb7791 Make checkout.*.prepare() delete the svn:ignored files.
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
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 9799a079c5 Accept svn:mime-type as a valid svn property.
R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@117133 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 5e975633a8 Fix handling of file renames.
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
14 years ago
maruel@chromium.org b1d1a78c8d Add post_processors override to apply_patch() and add more testing.
Move ReadOnlyCheckout tests into its own fixture.

R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@103272 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 87e6d33103 Update subprocess2.check_output() to behave like subprocess.check_output().
stderr is not redirected by default. stdout is not allowed.
Both were oversight.
Do not override stdin=None in case the user would response to stderr output for
example.

Increase test coverage.

R=dpranke@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100456 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 004fb7182b Replace OSError by the correct class IOError
R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@89884 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org a5129fb808 Fix Checkout.post_processsors setup. __init__() was ignoring the argument!
TEST=Rewrote the unit test to catch that case.

R=dpranke@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@89700 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 51919774d5 Make prepare() accept a revision argument.
R=dpranke@chromium.org
TEST=few
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@88779 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 6ed8b50be6 Make post_processors part of the Checkout object state.
R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@88777 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 4869bcfb2e Do no delete file if they exist, even if p.is_new is True.
For a yet unknown reason, a chmod +x on a git svn checkout will set a 'A'
status. Will investigate separately.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87903 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 58fe662dc7 Add support for empty files, __init__.py is a common example.
Use p.is_new signal and set it manually with rietveld patches.
Add regression test for +x.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87858 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 9842a0c754 Add support for auto-props in the form: "*.sh = svn:eol-style=LF;svn:executable"
It needs to be parsed manually and assumes '=*' for property that do not specify
a value.

Add clearer message on failure like that by specifiying the command line.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87255 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 1bf5097abc Enforce unicode commit message.
R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@84289 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 3cdb7f3661 Complete apply_issue.py.
This is to be able to apply patches directly from rietveld for the try server.

TEST=tested on both svn and git with binary files. unit tests will follow up.
R=dpranke@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@84255 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 0bcd1d3430 Make subprocess2.check_call() compliant with subprocess.check_call().
Rename check_call to check_call_out. It's a quite specific need when stderr is
needed or when the user doesn't want the default arguments of check_output.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@83023 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 8a1396cd72 Add post_process argument to Checkout.apply_patch().
This enables doing late modifications like updating the copyright notice or fixing line endings.

Also silence the checkout operations a bit more when VOID=subprocess2.VOID.

Add corresponding unit tests.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@82587 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org dfaecd2bd4 Move commit-queue/checkout into depot_tools so it can be reused by the try server.
BUG=
TEST=

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

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