Default gclient's GIT_MODE to True

Also contains some other changes (to the example, and to safesync url)
in order for test coverage to remain complete. Will be followed shortly
by a wholesale removal of svn support from the gclient module.

R=iannucci@chromium.org
BUG=640251

Review-Url: https://codereview.chromium.org/2270083004
changes/18/399118/1
agable 9 years ago committed by Commit bot
parent f14eaff814
commit 4b21db06e4

@ -153,7 +153,7 @@ class GclientApi(recipe_api.RecipeApi):
step_test_data = lambda: (
self.test_api.output_json(test_data_paths, cfg.GIT_MODE))
try:
if not cfg.GIT_MODE:
if not cfg.GIT_MODE: # pragma: no cover
args = ['sync', '--nohooks', '--force', '--verbose']
if cfg.delete_unversioned_trees:
args.append('--delete_unversioned_trees')
@ -239,7 +239,7 @@ class GclientApi(recipe_api.RecipeApi):
sync_step = None
try:
if not cfg.GIT_MODE:
if not cfg.GIT_MODE: # pragma: no cover
try:
if revert:
self.revert(**kwargs)
@ -266,7 +266,7 @@ class GclientApi(recipe_api.RecipeApi):
return sync_step
def revert(self, **kwargs):
def revert(self, **kwargs): # pragma: no cover
"""Return a gclient_safe_revert step."""
# Not directly calling gclient, so don't use self().
alias = self.spec_alias

@ -10,7 +10,7 @@ from recipe_engine.config import ConfigList, Dict, Single, Static, Set, List
from . import api as gclient_api
def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None,
def BaseConfig(USE_MIRROR=True, GIT_MODE=True, CACHE_DIR=None,
PATCH_PROJECT=None, BUILDSPEC_VERSION=None,
**_kwargs):
deps = '.DEPS.git' if GIT_MODE else 'DEPS'
@ -96,7 +96,7 @@ def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None,
config_ctx = config_item_context(BaseConfig)
def ChromiumSvnSubURL(c, *pieces):
def ChromiumSvnSubURL(c, *pieces): # pragma: no cover
BASES = ('https://src.chromium.org',
'svn://svn-mirror.golo.chromium.org')
return '/'.join((BASES[c.USE_MIRROR],) + pieces)
@ -106,19 +106,19 @@ def ChromiumGitURL(_c, *pieces):
def ChromiumSrcURL(c):
# TODO(phajdan.jr): Move to proper repo and add coverage.
if c.GIT_MODE: # pragma: no cover
if c.GIT_MODE:
return ChromiumGitURL(c, 'chromium', 'src.git')
else:
else: # pragma: no cover
return ChromiumSvnSubURL(c, 'chrome', 'trunk', 'src')
def BlinkURL(c):
# TODO(phajdan.jr): Move to proper repo and add coverage.
if c.GIT_MODE: # pragma: no cover
if c.GIT_MODE:
return ChromiumGitURL(c, 'chromium', 'blink.git')
else:
else: # pragma: no cover
return ChromiumSvnSubURL(c, 'blink', 'trunk')
def ChromeSvnSubURL(c, *pieces):
def ChromeSvnSubURL(c, *pieces): # pragma: no cover
BASES = ('svn://svn.chromium.org',
'svn://svn-mirror.golo.chromium.org')
return '/'.join((BASES[c.USE_MIRROR],) + pieces)
@ -129,9 +129,9 @@ def ChromeInternalGitURL(_c, *pieces): # pragma: no cover
def ChromeInternalSrcURL(c):
# TODO(phajdan.jr): Move to proper repo and add coverage.
if c.GIT_MODE: # pragma: no cover
if c.GIT_MODE:
return ChromeInternalGitURL(c, 'chrome', 'src-internal.git')
else:
else: # pragma: no cover
return ChromeSvnSubURL(c, 'chrome-internal', 'trunk', 'src-internal')
def mirror_only(c, obj, default=None):
@ -350,8 +350,8 @@ def gyp(c):
m['gyp'] = 'got_revision'
@config_ctx(config_vars={'GIT_MODE': True})
def build(c): # pragma: no cover
if not c.GIT_MODE:
def build(c):
if not c.GIT_MODE: # pragma: no cover
raise BadConf('build only supports git')
s = c.solutions.add()
s.name = 'build'
@ -380,7 +380,7 @@ def skia(c): # pragma: no cover
m['skia'] = 'got_revision'
@config_ctx(config_vars={'GIT_MODE': True})
def chrome_golo(c): # pragma: no cover
def chrome_golo(c): # pragma: no cover
if not c.GIT_MODE:
raise BadConf('chrome_golo only supports git')
s = c.solutions.add()

@ -85,7 +85,7 @@
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"config",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
@ -99,11 +99,15 @@
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"sync",
"--verbose",
"--with_branch_heads",
"--nohooks",
"-j8",
"--reset",
"--force",
"--verbose",
"--upstream",
"--no-nag-max",
"--delete_unversioned_trees",
"--with_branch_heads",
"--revision",
"third_party/WebKit@123",
"--output-json",
@ -118,17 +122,51 @@
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"WebKit/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 241198@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"3eebce6ea96f9e6c03e9252a4f8ef2ea9fe141c2\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"src/blatley/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 248087@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"5e800497199d615131a76cd10651e74d7c8a0962\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_blatley_revision@248087@@@"
"@@@SET_BUILD_PROPERTY@got_blatley_revision@\"5e800497199d615131a76cd10651e74d7c8a0962\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.name",
"local_bot"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: WebKit] gclient recurse (git config user.name)"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.email",
"local_bot@example.com"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: WebKit] gclient recurse (git config user.email)"
},
{
"cmd": [
"python",

@ -87,7 +87,7 @@
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"config",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
@ -101,11 +101,15 @@
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"sync",
"--verbose",
"--with_branch_heads",
"--nohooks",
"-j8",
"--reset",
"--force",
"--verbose",
"--upstream",
"--no-nag-max",
"--delete_unversioned_trees",
"--with_branch_heads",
"--revision",
"third_party/WebKit@123",
"--output-json",
@ -120,17 +124,51 @@
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"WebKit/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 241198@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"3eebce6ea96f9e6c03e9252a4f8ef2ea9fe141c2\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"src/blatley/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 248087@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"5e800497199d615131a76cd10651e74d7c8a0962\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_blatley_revision@248087@@@"
"@@@SET_BUILD_PROPERTY@got_blatley_revision@\"5e800497199d615131a76cd10651e74d7c8a0962\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.name",
"local_bot"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: WebKit] gclient recurse (git config user.name)"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.email",
"local_bot@example.com"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: WebKit] gclient recurse (git config user.email)"
},
{
"cmd": [
"python",

@ -87,7 +87,7 @@
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"config",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
@ -95,28 +95,21 @@
},
"name": "[spec: WebKit] gclient setup"
},
{
"cmd": [
"python",
"-u",
"[BUILD]/scripts/slave/gclient_safe_revert.py",
".",
"[DEPOT_TOOLS]/gclient"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"name": "[spec: WebKit] gclient revert"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"sync",
"--verbose",
"--with_branch_heads",
"--nohooks",
"-j8",
"--reset",
"--force",
"--verbose",
"--upstream",
"--no-nag-max",
"--delete_unversioned_trees",
"--with_branch_heads",
"--revision",
"third_party/WebKit@123",
"--output-json",
@ -131,17 +124,51 @@
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"WebKit/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 241198@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"3eebce6ea96f9e6c03e9252a4f8ef2ea9fe141c2\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"src/blatley/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 248087@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"5e800497199d615131a76cd10651e74d7c8a0962\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_blatley_revision@248087@@@"
"@@@SET_BUILD_PROPERTY@got_blatley_revision@\"5e800497199d615131a76cd10651e74d7c8a0962\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.name",
"local_bot"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: WebKit] gclient recurse (git config user.name)"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.email",
"local_bot@example.com"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: WebKit] gclient recurse (git config user.email)"
},
{
"cmd": [
"python",

@ -32,6 +32,6 @@ class GclientTestApi(recipe_test_api.RecipeTestApi):
h = hashlib.sha1(project)
if GIT_MODE:
return h.hexdigest()
else:
else: # pragma: no cover
import struct
return struct.unpack('!I', h.digest()[:4])[0] % 300000

Loading…
Cancel
Save