Commit 52a23b35 authored by Stephen Martinis's avatar Stephen Martinis Committed by Commit Bot

Remove svn support from tryserver module

Change-Id: Ic6109dff73f6726c1b50d107dc0996d1a0d0fcf4
Reviewed-on: https://chromium-review.googlesource.com/437637
Commit-Queue: Stephen Martinis <martiniss@chromium.org>
Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
parent 328b00f9
......@@ -11,7 +11,6 @@ from recipe_engine import recipe_api
PATCH_STORAGE_RIETVELD = 'rietveld'
PATCH_STORAGE_GIT = 'git'
PATCH_STORAGE_SVN = 'svn'
class TryserverApi(recipe_api.RecipeApi):
......@@ -19,17 +18,11 @@ class TryserverApi(recipe_api.RecipeApi):
super(TryserverApi, self).__init__(*args, **kwargs)
self._failure_reasons = []
@property
def patch_url(self):
"""Reads patch_url property and corrects it if needed."""
url = self.m.properties.get('patch_url')
return url
@property
def is_tryserver(self):
"""Returns true iff we can apply_issue or patch."""
return (self.can_apply_issue or self.is_patch_in_svn or
self.is_patch_in_git or self.is_gerrit_issue)
return (
self.can_apply_issue or self.is_patch_in_git or self.is_gerrit_issue)
@property
def can_apply_issue(self):
......@@ -48,11 +41,6 @@ class TryserverApi(recipe_api.RecipeApi):
'event.change.url' in self.m.properties and
'event.change.id' in self.m.properties)
@property
def is_patch_in_svn(self):
"""Returns true iff the properties exist to patch from a patch URL."""
return self.patch_url
@property
def is_patch_in_git(self):
return (self.m.properties.get('patch_storage') == PATCH_STORAGE_GIT and
......@@ -76,27 +64,6 @@ class TryserverApi(recipe_api.RecipeApi):
self.m.step('apply patch', patch_cmd,
stdin=patch_content)
def apply_from_svn(self, cwd):
"""Downloads patch from patch_url using svn-export and applies it"""
# TODO(nodir): accept these properties as parameters
patch_url = self.patch_url
root = cwd
if root is None:
issue_root = self.m.rietveld.calculate_issue_root()
root = self.m.path['checkout'].join(issue_root)
patch_file = self.m.raw_io.output('.diff')
ext = '.bat' if self.m.platform.is_win else ''
svn_cmd = ['svn' + ext, 'export', '--force', patch_url, patch_file]
result = self.m.step('download patch', svn_cmd,
step_test_data=self.test_api.patch_content)
result.presentation.logs['patch.diff'] = (
result.raw_io.output.split('\n'))
patch_content = self.m.raw_io.input(result.raw_io.output)
self._apply_patch_step(patch_content=patch_content, root=root)
def apply_from_git(self, cwd):
"""Downloads patch from given git repo and ref and applies it"""
# TODO(nodir): accept these properties as parameters
......@@ -134,8 +101,6 @@ class TryserverApi(recipe_api.RecipeApi):
if self.can_apply_issue:
return PATCH_STORAGE_RIETVELD
elif self.is_patch_in_svn:
return PATCH_STORAGE_SVN
def maybe_apply_issue(self, cwd=None, authentication=None):
"""If we're a trybot, apply a codereview issue.
......@@ -152,8 +117,6 @@ class TryserverApi(recipe_api.RecipeApi):
return self.m.rietveld.apply_issue(
self.m.rietveld.calculate_issue_root(),
authentication=authentication)
elif storage == PATCH_STORAGE_SVN:
return self.apply_from_svn(cwd)
elif storage == PATCH_STORAGE_GIT:
return self.apply_from_git(cwd)
else:
......
[
{
"cmd": [
"svn",
"export",
"--force",
"svn://checkout.url",
"/path/to/tmp/diff"
],
"name": "download patch",
"~followup_annotations": [
"@@@STEP_LOG_LINE@patch.diff@fake patch.diff content (line 1)@@@",
"@@@STEP_LOG_LINE@patch.diff@fake patch.diff content (line 2)@@@",
"@@@STEP_LOG_LINE@patch.diff@@@@",
"@@@STEP_LOG_END@patch.diff@@@"
]
},
{
"cmd": [
"patch",
"--dir",
"[START_DIR]",
"--force",
"--forward",
"--remove-empty-files",
"--strip",
"0"
],
"name": "apply patch",
"stdin": "fake patch.diff content (line 1)\nfake patch.diff content (line 2)\n"
},
{
"cmd": [
"git",
"diff",
"--cached",
"--name-only"
],
"cwd": "[START_DIR]",
"name": "git diff to analyze patch",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@files@foo.cc@@@",
"@@@STEP_LOG_END@files@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"INVALID_TEST_RESULTS\"@@@",
"@@@SET_BUILD_PROPERTY@subproject_tag@\"v8\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"name": "fail",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@foo@@@",
"@@@STEP_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_hash@\"c2311ad770732eade3d2f48247abd147e40a70e7\"@@@"
]
},
{
"name": "$result",
"reason": "Step('fail') failed with return_code 1",
"recipe_result": null,
"status_code": 1
}
]
\ No newline at end of file
......@@ -49,9 +49,6 @@ def RunSteps(api):
def GenTests(api):
description_step = api.override_step_data(
'git_cl description', stdout=api.raw_io.output('foobar'))
yield (api.test('with_svn_patch') +
api.properties(patch_url='svn://checkout.url'))
yield (api.test('with_git_patch') +
api.properties(
path_config='buildbot',
......@@ -112,4 +109,4 @@ def GenTests(api):
)
yield (api.test('set_failure_hash_with_no_steps') +
api.properties(set_failure_hash_with_no_steps=True))
\ No newline at end of file
api.properties(set_failure_hash_with_no_steps=True))
from recipe_engine import recipe_test_api
class TryserverTestApi(recipe_test_api.RecipeTestApi):
def patch_content(self):
return self.m.raw_io.output(
'fake patch.diff content (line 1)\n'
'fake patch.diff content (line 2)\n')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment