libv8 6.3.292.48.1 → 6.7.288.46.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +10 -34
- data/CHANGELOG.md +16 -0
- data/README.md +9 -63
- data/Rakefile +2 -2
- data/ext/libv8/builder.rb +22 -87
- data/ext/libv8/extconf.rb +1 -1
- data/ext/libv8/paths.rb +5 -18
- data/lib/libv8/version.rb +1 -1
- data/spec/location_spec.rb +1 -2
- data/spec/spec_helper.rb +0 -1
- data/vendor/depot_tools/.gitattributes +1 -2
- data/vendor/depot_tools/OWNERS +0 -1
- data/vendor/depot_tools/PRESUBMIT.py +11 -6
- data/vendor/depot_tools/README.md +0 -1
- data/vendor/depot_tools/WATCHLISTS +0 -6
- data/vendor/depot_tools/auth.py +129 -87
- data/vendor/depot_tools/autoninja +11 -1
- data/vendor/depot_tools/autoninja.bat +7 -1
- data/vendor/depot_tools/autoninja.py +14 -6
- data/vendor/depot_tools/bootstrap/win/manifest.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +1 -1
- data/vendor/depot_tools/cipd +23 -2
- data/vendor/depot_tools/cipd.bat +2 -2
- data/vendor/depot_tools/cipd_client_version +1 -1
- data/vendor/depot_tools/cipd_manifest.txt +17 -7
- data/vendor/depot_tools/cit.py +7 -6
- data/vendor/depot_tools/cpplint.py +195 -35
- data/vendor/depot_tools/detect_host_arch.py +51 -0
- data/vendor/depot_tools/download_from_google_storage.py +85 -26
- data/vendor/depot_tools/fetch.py +11 -6
- data/vendor/depot_tools/fetch_configs/chromium.py +0 -1
- data/vendor/depot_tools/fetch_configs/goma_client.py +41 -0
- data/vendor/depot_tools/fetch_configs/infra.py +0 -1
- data/vendor/depot_tools/fetch_configs/infra_internal.py +0 -1
- data/vendor/depot_tools/gclient-new-workdir.py +4 -0
- data/vendor/depot_tools/gclient.py +732 -476
- data/vendor/depot_tools/gclient_eval.py +569 -58
- data/vendor/depot_tools/gclient_scm.py +258 -46
- data/vendor/depot_tools/gclient_utils.py +17 -1
- data/vendor/depot_tools/gerrit_util.py +46 -13
- data/vendor/depot_tools/git_cache.py +0 -2
- data/vendor/depot_tools/git_cl.py +176 -335
- data/vendor/depot_tools/git_common.py +19 -16
- data/vendor/depot_tools/git_footers.py +19 -5
- data/vendor/depot_tools/git_hyper_blame.py +9 -3
- data/vendor/depot_tools/git_new_branch.py +15 -3
- data/vendor/depot_tools/git_upstream_diff.py +7 -2
- data/vendor/depot_tools/gsutil.py +1 -1
- data/vendor/depot_tools/infra/config/cq.cfg +1 -2
- data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
- data/vendor/depot_tools/luci-auth +13 -0
- data/vendor/depot_tools/luci-auth.bat +8 -0
- data/vendor/depot_tools/man/html/depot_tools.html +0 -8
- data/vendor/depot_tools/man/html/git-upstream-diff.html +20 -3
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +27 -6
- data/vendor/depot_tools/man/man7/depot_tools.7 +0 -5
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +2 -2
- data/vendor/depot_tools/man/src/git-upstream-diff.txt +21 -3
- data/vendor/depot_tools/man/src/make_docs.sh +6 -0
- data/vendor/depot_tools/my_activity.py +283 -93
- data/vendor/depot_tools/owners.py +9 -4
- data/vendor/depot_tools/owners_finder.py +7 -3
- data/vendor/depot_tools/post_build_ninja_summary.py +322 -0
- data/vendor/depot_tools/presubmit_canned_checks.py +91 -106
- data/vendor/depot_tools/presubmit_support.py +219 -157
- data/vendor/depot_tools/prpc +13 -0
- data/vendor/depot_tools/prpc.bat +8 -0
- data/vendor/depot_tools/recipes/OWNERS +3 -1
- data/vendor/depot_tools/recipes/README.recipes.md +70 -111
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +12 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +36 -68
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange_oauth2_json.json → no_apply_patch_on_gclient.json} +64 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{no_shallow.json → shallow.json} +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_empty_revision.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +0 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +0 -7
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +0 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle_deprecated.json +44 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange_oauth2_buildbot.json → tryjob_gerrit_branch_heads.json} +51 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +48 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +19 -26
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +193 -155
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +9 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +2 -7
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +31 -5
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +37 -19
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +37 -19
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +37 -19
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +37 -23
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +4 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +40 -8
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.py +6 -3
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/OWNERS +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +7 -56
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +15 -16
- data/vendor/depot_tools/recipes/recipes.py +4 -2
- data/vendor/depot_tools/recipes/trigger_recipe_roller.txt +12 -0
- data/vendor/depot_tools/roll_dep.py +35 -37
- data/vendor/depot_tools/support/chromite_wrapper +1 -1
- data/vendor/depot_tools/third_party/logilab/astroid/README.chromium +3 -3
- data/vendor/depot_tools/third_party/logilab/astroid/__pkginfo__.py +2 -2
- data/vendor/depot_tools/third_party/logilab/astroid/astpeephole.py +86 -0
- data/vendor/depot_tools/third_party/logilab/astroid/bases.py +53 -66
- data/vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py +31 -31
- data/vendor/depot_tools/third_party/logilab/astroid/brain/pynose.py +39 -16
- data/vendor/depot_tools/third_party/logilab/astroid/brain/pysix_moves.py +225 -189
- data/vendor/depot_tools/third_party/logilab/astroid/inference.py +45 -41
- data/vendor/depot_tools/third_party/logilab/astroid/manager.py +1 -0
- data/vendor/depot_tools/third_party/logilab/astroid/modutils.py +2 -2
- data/vendor/depot_tools/third_party/logilab/astroid/node_classes.py +3 -2
- data/vendor/depot_tools/third_party/logilab/astroid/nodes.py +1 -0
- data/vendor/depot_tools/third_party/logilab/astroid/protocols.py +57 -3
- data/vendor/depot_tools/third_party/logilab/astroid/raw_building.py +1 -1
- data/vendor/depot_tools/third_party/logilab/astroid/rebuilder.py +21 -1
- data/vendor/depot_tools/third_party/logilab/astroid/scoped_nodes.py +58 -33
- data/vendor/depot_tools/third_party/pylint/README.chromium +2 -2
- data/vendor/depot_tools/third_party/pylint/__pkginfo__.py +3 -3
- data/vendor/depot_tools/third_party/pylint/checkers/base.py +6 -18
- data/vendor/depot_tools/third_party/pylint/checkers/classes.py +64 -63
- data/vendor/depot_tools/third_party/pylint/checkers/design_analysis.py +25 -57
- data/vendor/depot_tools/third_party/pylint/checkers/format.py +14 -10
- data/vendor/depot_tools/third_party/pylint/checkers/python3.py +142 -37
- data/vendor/depot_tools/third_party/pylint/checkers/spelling.py +10 -1
- data/vendor/depot_tools/third_party/pylint/checkers/stdlib.py +50 -7
- data/vendor/depot_tools/third_party/pylint/checkers/strings.py +1 -1
- data/vendor/depot_tools/third_party/pylint/epylint.py +2 -1
- data/vendor/depot_tools/third_party/pylint/gui.py +1 -1
- data/vendor/depot_tools/third_party/pylint/lint.py +88 -23
- data/vendor/depot_tools/third_party/pylint/reporters/html.py +37 -5
- data/vendor/depot_tools/third_party/pylint/testutils.py +1 -1
- data/vendor/depot_tools/third_party/pylint/utils.py +5 -0
- data/vendor/depot_tools/vpython +31 -1
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +35 -2
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +0 -15
- data/vendor/depot_tools/yapf +17 -0
- data/vendor/depot_tools/{apply_issue.bat → yapf.bat} +2 -2
- metadata +16 -58
- data/ext/libv8/compiler.rb +0 -39
- data/ext/libv8/compiler/apple_llvm.rb +0 -22
- data/ext/libv8/compiler/clang.rb +0 -22
- data/ext/libv8/compiler/gcc.rb +0 -22
- data/ext/libv8/compiler/generic_compiler.rb +0 -66
- data/ext/libv8/make.rb +0 -13
- data/ext/libv8/patcher.rb +0 -21
- data/patches/0001-Build-a-standalone-static-library.patch +0 -26
- data/patches/0002-Don-t-compile-unnecessary-stuff.patch +0 -85
- data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +0 -25
- data/patches/0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch +0 -25
- data/patches/0005-Remove-TryInstallOptimizedCode.patch +0 -321
- data/patches/mingw-generate-makefiles.sh +0 -97
- data/spec/compiler/apple_llvm_spec.rb +0 -37
- data/spec/compiler/clang_spec.rb +0 -37
- data/spec/compiler/gcc_spec.rb +0 -37
- data/spec/compiler/generic_compiler_spec.rb +0 -50
- data/spec/compiler_spec.rb +0 -45
- data/spec/support/compiler_helpers.rb +0 -47
- data/vendor/depot_tools/apply_issue +0 -8
- data/vendor/depot_tools/apply_issue.py +0 -315
- data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +0 -815
- data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +0 -80
- data/vendor/depot_tools/man/src/_git-cherry-pick-upload_desc.helper.txt +0 -1
- data/vendor/depot_tools/man/src/git-cherry-pick-upload.demo.1.sh +0 -17
- data/vendor/depot_tools/man/src/git-cherry-pick-upload.txt +0 -35
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2_json_win.json +0 -196
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/__init__.py +0 -6
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/api.py +0 -97
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/basic.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/buildbot.json +0 -30
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/no_auth.json +0 -27
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.py +0 -38
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_rietveld_patch.json +0 -69
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_rietveld_patch_new.json +0 -69
- data/vendor/depot_tools/third_party/cq_client/OWNERS +0 -2
- data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +0 -2
- data/vendor/depot_tools/third_party/cq_client/README.md +0 -59
- data/vendor/depot_tools/third_party/cq_client/__init__.py +0 -3
- data/vendor/depot_tools/third_party/cq_client/v1/__init__.py +0 -3
- data/vendor/depot_tools/third_party/cq_client/v1/cq.pb.go +0 -810
- data/vendor/depot_tools/third_party/cq_client/v1/cq.proto +0 -281
- data/vendor/depot_tools/third_party/cq_client/v1/cq_pb2.py +0 -794
- data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_both.cfg +0 -71
- data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_gerrit.cfg +0 -58
- data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_rietveld.cfg +0 -60
- data/vendor/depot_tools/third_party/cq_client/v2/__init__.py +0 -3
- data/vendor/depot_tools/third_party/cq_client/v2/cq.pb.go +0 -792
- data/vendor/depot_tools/third_party/cq_client/v2/cq.proto +0 -270
- data/vendor/depot_tools/third_party/cq_client/v2/cq_pb2.py +0 -841
@@ -107,7 +107,9 @@ def parse(repo_root, recipes_cfg_path):
|
|
107
107
|
raise MalformedRecipesCfg(ex.message, recipes_cfg_path)
|
108
108
|
|
109
109
|
|
110
|
-
|
110
|
+
_BAT = '.bat' if sys.platform.startswith(('win', 'cygwin')) else ''
|
111
|
+
GIT = 'git' + _BAT
|
112
|
+
VPYTHON = 'vpython' + _BAT
|
111
113
|
|
112
114
|
|
113
115
|
def _subprocess_call(argv, **kwargs):
|
@@ -208,7 +210,7 @@ def main():
|
|
208
210
|
engine_path = checkout_engine(engine_override, repo_root, recipes_cfg_path)
|
209
211
|
|
210
212
|
return _subprocess_call([
|
211
|
-
|
213
|
+
VPYTHON, '-u',
|
212
214
|
os.path.join(engine_path, 'recipes.py')] + args)
|
213
215
|
|
214
216
|
|
@@ -1 +1,13 @@
|
|
1
1
|
No-op file. Edit this to kick recipes.
|
2
|
+
|
3
|
+
This is a beginning of a story in this silly file.
|
4
|
+
Once upon a time, a budding web browser dev team needed a CI system.
|
5
|
+
All they had was one poor machine under a desk, and its name was Batty,
|
6
|
+
the Build and Test Yeti.
|
7
|
+
|
8
|
+
As the CI needs of the browser grew, Batty, the Build and Test Yeti, got
|
9
|
+
a new friend, but this information was marked RVG, so it was months before
|
10
|
+
any details were revealed.
|
11
|
+
|
12
|
+
|
13
|
+
The End!
|
@@ -10,6 +10,8 @@ script will always roll to the tip of to origin/master.
|
|
10
10
|
"""
|
11
11
|
|
12
12
|
import argparse
|
13
|
+
import collections
|
14
|
+
import gclient_eval
|
13
15
|
import os
|
14
16
|
import re
|
15
17
|
import subprocess
|
@@ -68,6 +70,12 @@ def should_show_log(upstream_url):
|
|
68
70
|
return True
|
69
71
|
|
70
72
|
|
73
|
+
def get_gclient_root():
|
74
|
+
gclient = os.path.join(
|
75
|
+
os.path.dirname(os.path.abspath(__file__)), 'gclient.py')
|
76
|
+
return check_output([sys.executable, gclient, 'root']).strip()
|
77
|
+
|
78
|
+
|
71
79
|
def get_deps(root):
|
72
80
|
"""Returns the path and the content of the DEPS file."""
|
73
81
|
deps_path = os.path.join(root, 'DEPS')
|
@@ -122,27 +130,13 @@ def generate_commit_message(
|
|
122
130
|
return header + log_section
|
123
131
|
|
124
132
|
|
125
|
-
def calculate_roll(full_dir, dependency,
|
126
|
-
"""Calculates the roll for a dependency by processing
|
133
|
+
def calculate_roll(full_dir, dependency, gclient_dict, roll_to):
|
134
|
+
"""Calculates the roll for a dependency by processing gclient_dict, and
|
127
135
|
fetching the dependency via git.
|
128
136
|
"""
|
129
|
-
head =
|
130
|
-
if not head
|
131
|
-
|
132
|
-
dependency)
|
133
|
-
if not key:
|
134
|
-
key = dependency
|
135
|
-
|
136
|
-
# It happens if the user checked out a branch in the dependency by himself.
|
137
|
-
# Fall back to reading the DEPS to figure out the original commit.
|
138
|
-
for i in deps_content.splitlines():
|
139
|
-
m = re.match(r'\s+"' + key + '":.*"([a-z0-9]{40})",', i)
|
140
|
-
if m:
|
141
|
-
head = m.group(1)
|
142
|
-
break
|
143
|
-
else:
|
144
|
-
raise Error('Expected to find commit %s for %s in DEPS' % (head, key))
|
145
|
-
|
137
|
+
head = gclient_eval.GetRevision(gclient_dict, dependency)
|
138
|
+
if not head:
|
139
|
+
raise Error('%s is unpinned.' % dependency)
|
146
140
|
check_call(['git', 'fetch', 'origin', '--quiet'], cwd=full_dir)
|
147
141
|
roll_to = check_output(['git', 'rev-parse', roll_to], cwd=full_dir).strip()
|
148
142
|
return head, roll_to
|
@@ -154,28 +148,27 @@ def gen_commit_msg(logs, cmdline, rolls, reviewers, bug):
|
|
154
148
|
if len(logs) > 1:
|
155
149
|
commit_msg = 'Rolling %d dependencies\n\n' % len(logs)
|
156
150
|
commit_msg += '\n\n'.join(logs)
|
157
|
-
commit_msg += '\nCreated with:\n ' + cmdline
|
151
|
+
commit_msg += '\nCreated with:\n ' + cmdline + '\n'
|
158
152
|
commit_msg += 'R=%s\n' % ','.join(reviewers) if reviewers else ''
|
159
153
|
commit_msg += 'BUG=%s\n' % bug if bug else ''
|
160
154
|
return commit_msg
|
161
155
|
|
162
156
|
|
163
|
-
def finalize(commit_msg, deps_path, deps_content, rolls):
|
157
|
+
def finalize(commit_msg, deps_path, deps_content, rolls, is_relative, root_dir):
|
164
158
|
"""Edits the DEPS file, commits it, then uploads a CL."""
|
165
159
|
print('Commit message:')
|
166
160
|
print('\n'.join(' ' + i for i in commit_msg.splitlines()))
|
167
161
|
|
168
162
|
with open(deps_path, 'wb') as f:
|
169
163
|
f.write(deps_content)
|
170
|
-
|
171
|
-
check_call(['git', 'add', 'DEPS'], cwd=
|
172
|
-
check_call(['git', 'commit', '--quiet', '-m', commit_msg], cwd=
|
164
|
+
current_dir = os.path.dirname(deps_path)
|
165
|
+
check_call(['git', 'add', 'DEPS'], cwd=current_dir)
|
166
|
+
check_call(['git', 'commit', '--quiet', '-m', commit_msg], cwd=current_dir)
|
173
167
|
|
174
168
|
# Pull the dependency to the right revision. This is surprising to users
|
175
169
|
# otherwise.
|
176
170
|
for dependency, (_head, roll_to) in sorted(rolls.iteritems()):
|
177
|
-
full_dir = os.path.normpath(
|
178
|
-
os.path.join(os.path.dirname(root), dependency))
|
171
|
+
full_dir = os.path.normpath(os.path.join(root_dir, dependency))
|
179
172
|
check_call(['git', 'checkout', '--quiet', roll_to], cwd=full_dir)
|
180
173
|
|
181
174
|
|
@@ -220,24 +213,28 @@ def main():
|
|
220
213
|
if not '@' in r:
|
221
214
|
reviewers[i] = r + '@chromium.org'
|
222
215
|
|
223
|
-
|
216
|
+
gclient_root = get_gclient_root()
|
217
|
+
current_dir = os.getcwd()
|
224
218
|
dependencies = sorted(d.rstrip('/').rstrip('\\') for d in args.dep_path)
|
225
219
|
cmdline = 'roll-dep ' + ' '.join(dependencies) + ''.join(
|
226
220
|
' --key ' + k for k in args.key)
|
227
221
|
try:
|
228
|
-
if not args.ignore_dirty_tree and not is_pristine(
|
229
|
-
raise Error(
|
222
|
+
if not args.ignore_dirty_tree and not is_pristine(current_dir):
|
223
|
+
raise Error(
|
224
|
+
'Ensure %s is clean first (no non-merged commits).' % current_dir)
|
230
225
|
# First gather all the information without modifying anything, except for a
|
231
226
|
# git fetch.
|
232
|
-
deps_path, deps_content = get_deps(
|
227
|
+
deps_path, deps_content = get_deps(current_dir)
|
228
|
+
gclient_dict = gclient_eval.Exec(deps_content, deps_path)
|
229
|
+
is_relative = gclient_dict.get('use_relative_paths', False)
|
230
|
+
root_dir = current_dir if is_relative else gclient_root
|
233
231
|
rolls = {}
|
234
232
|
for dependency in dependencies:
|
235
|
-
full_dir = os.path.normpath(
|
236
|
-
os.path.join(os.path.dirname(root), dependency))
|
233
|
+
full_dir = os.path.normpath(os.path.join(root_dir, dependency))
|
237
234
|
if not os.path.isdir(full_dir):
|
238
235
|
raise Error('Directory not found: %s (%s)' % (dependency, full_dir))
|
239
236
|
head, roll_to = calculate_roll(
|
240
|
-
full_dir, dependency,
|
237
|
+
full_dir, dependency, gclient_dict, args.roll_to)
|
241
238
|
if roll_to == head:
|
242
239
|
if len(dependencies) == 1:
|
243
240
|
raise AlreadyRolledError('No revision to roll!')
|
@@ -249,15 +246,16 @@ def main():
|
|
249
246
|
|
250
247
|
logs = []
|
251
248
|
for dependency, (head, roll_to) in sorted(rolls.iteritems()):
|
252
|
-
full_dir = os.path.normpath(
|
253
|
-
os.path.join(os.path.dirname(root), dependency))
|
249
|
+
full_dir = os.path.normpath(os.path.join(root_dir, dependency))
|
254
250
|
log = generate_commit_message(
|
255
251
|
full_dir, dependency, head, roll_to, args.no_log, args.log_limit)
|
256
252
|
logs.append(log)
|
257
|
-
|
253
|
+
gclient_eval.SetRevision(gclient_dict, dependency, roll_to)
|
254
|
+
|
255
|
+
deps_content = gclient_eval.RenderDEPSFile(gclient_dict)
|
258
256
|
|
259
257
|
commit_msg = gen_commit_msg(logs, cmdline, rolls, reviewers, args.bug)
|
260
|
-
finalize(commit_msg, deps_path, deps_content, rolls)
|
258
|
+
finalize(commit_msg, deps_path, deps_content, rolls, is_relative, root_dir)
|
261
259
|
except Error as e:
|
262
260
|
sys.stderr.write('error: %s\n' % e)
|
263
261
|
return 2 if isinstance(e, AlreadyRolledError) else 1
|
@@ -1,10 +1,10 @@
|
|
1
|
-
URL:
|
2
|
-
Version: 1.3.
|
1
|
+
URL: https://github.com/PyCQA/astroid
|
2
|
+
Version: 1.3.8
|
3
3
|
License: GPL
|
4
4
|
License File: LICENSE.txt
|
5
5
|
|
6
6
|
Description:
|
7
|
-
This directory contains the
|
7
|
+
This directory contains the astroid module, required for pylint.
|
8
8
|
|
9
9
|
Local Modifications:
|
10
10
|
None
|
@@ -20,10 +20,10 @@ distname = 'astroid'
|
|
20
20
|
|
21
21
|
modname = 'astroid'
|
22
22
|
|
23
|
-
numversion = (1, 3,
|
23
|
+
numversion = (1, 3, 8)
|
24
24
|
version = '.'.join([str(num) for num in numversion])
|
25
25
|
|
26
|
-
install_requires = ['logilab-common
|
26
|
+
install_requires = ['logilab-common>=0.63.0', 'six']
|
27
27
|
|
28
28
|
license = 'LGPL'
|
29
29
|
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
+
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
+
#
|
4
|
+
# This file is part of astroid.
|
5
|
+
#
|
6
|
+
# astroid is free software: you can redistribute it and/or modify it
|
7
|
+
# under the terms of the GNU Lesser General Public License as published by the
|
8
|
+
# Free Software Foundation, either version 2.1 of the License, or (at your
|
9
|
+
# option) any later version.
|
10
|
+
#
|
11
|
+
# astroid is distributed in the hope that it will be useful, but
|
12
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
13
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
14
|
+
# for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
+
# with astroid. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
"""Small AST optimizations."""
|
19
|
+
|
20
|
+
import _ast
|
21
|
+
|
22
|
+
from astroid import nodes
|
23
|
+
|
24
|
+
|
25
|
+
__all__ = ('ASTPeepholeOptimizer', )
|
26
|
+
|
27
|
+
|
28
|
+
try:
|
29
|
+
_TYPES = (_ast.Str, _ast.Bytes)
|
30
|
+
except AttributeError:
|
31
|
+
_TYPES = (_ast.Str, )
|
32
|
+
|
33
|
+
|
34
|
+
class ASTPeepholeOptimizer(object):
|
35
|
+
"""Class for applying small optimizations to generate new AST."""
|
36
|
+
|
37
|
+
def optimize_binop(self, node):
|
38
|
+
"""Optimize BinOps with string Const nodes on the lhs.
|
39
|
+
|
40
|
+
This fixes an infinite recursion crash, where multiple
|
41
|
+
strings are joined using the addition operator. With a
|
42
|
+
sufficient number of such strings, astroid will fail
|
43
|
+
with a maximum recursion limit exceeded. The
|
44
|
+
function will return a Const node with all the strings
|
45
|
+
already joined.
|
46
|
+
Return ``None`` if no AST node can be obtained
|
47
|
+
through optimization.
|
48
|
+
"""
|
49
|
+
ast_nodes = []
|
50
|
+
current = node
|
51
|
+
while isinstance(current, _ast.BinOp):
|
52
|
+
# lhs must be a BinOp with the addition operand.
|
53
|
+
if not isinstance(current.left, _ast.BinOp):
|
54
|
+
return
|
55
|
+
if (not isinstance(current.left.op, _ast.Add)
|
56
|
+
or not isinstance(current.op, _ast.Add)):
|
57
|
+
return
|
58
|
+
|
59
|
+
# rhs must a str / bytes.
|
60
|
+
if not isinstance(current.right, _TYPES):
|
61
|
+
return
|
62
|
+
|
63
|
+
ast_nodes.append(current.right.s)
|
64
|
+
current = current.left
|
65
|
+
|
66
|
+
if (isinstance(current, _ast.BinOp)
|
67
|
+
and isinstance(current.left, _TYPES)
|
68
|
+
and isinstance(current.right, _TYPES)):
|
69
|
+
# Stop early if we are at the last BinOp in
|
70
|
+
# the operation
|
71
|
+
ast_nodes.append(current.right.s)
|
72
|
+
ast_nodes.append(current.left.s)
|
73
|
+
break
|
74
|
+
|
75
|
+
if not ast_nodes:
|
76
|
+
return
|
77
|
+
|
78
|
+
# If we have inconsistent types, bail out.
|
79
|
+
known = type(ast_nodes[0])
|
80
|
+
if any(type(element) is not known
|
81
|
+
for element in ast_nodes[1:]):
|
82
|
+
return
|
83
|
+
|
84
|
+
value = known().join(reversed(ast_nodes))
|
85
|
+
newnode = nodes.Const(value)
|
86
|
+
return newnode
|
@@ -58,52 +58,28 @@ class Proxy(object):
|
|
58
58
|
|
59
59
|
# Inference ##################################################################
|
60
60
|
|
61
|
-
MISSING = object()
|
62
|
-
|
63
|
-
|
64
61
|
class InferenceContext(object):
|
65
|
-
__slots__ = ('path', 'callcontext', 'boundnode', 'infered')
|
66
|
-
|
67
|
-
def __init__(self,
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
def
|
81
|
-
#
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
# End the containing generator
|
87
|
-
raise StopIteration
|
88
|
-
|
89
|
-
return InferenceContext(
|
90
|
-
self.path.union([key]),
|
91
|
-
self.callcontext,
|
92
|
-
self.boundnode,
|
93
|
-
self.infered,
|
94
|
-
)
|
95
|
-
|
96
|
-
@contextmanager
|
97
|
-
def scope(self, callcontext=MISSING, boundnode=MISSING):
|
98
|
-
try:
|
99
|
-
orig = self.callcontext, self.boundnode
|
100
|
-
if callcontext is not MISSING:
|
101
|
-
self.callcontext = callcontext
|
102
|
-
if boundnode is not MISSING:
|
103
|
-
self.boundnode = boundnode
|
104
|
-
yield
|
105
|
-
finally:
|
106
|
-
self.callcontext, self.boundnode = orig
|
62
|
+
__slots__ = ('path', 'lookupname', 'callcontext', 'boundnode', 'infered')
|
63
|
+
|
64
|
+
def __init__(self, path=None, infered=None):
|
65
|
+
self.path = path or set()
|
66
|
+
self.lookupname = None
|
67
|
+
self.callcontext = None
|
68
|
+
self.boundnode = None
|
69
|
+
self.infered = infered or {}
|
70
|
+
|
71
|
+
def push(self, node):
|
72
|
+
name = self.lookupname
|
73
|
+
if (node, name) in self.path:
|
74
|
+
raise StopIteration()
|
75
|
+
self.path.add((node, name))
|
76
|
+
|
77
|
+
def clone(self):
|
78
|
+
# XXX copy lookupname/callcontext ?
|
79
|
+
clone = InferenceContext(self.path, infered=self.infered)
|
80
|
+
clone.callcontext = self.callcontext
|
81
|
+
clone.boundnode = self.boundnode
|
82
|
+
return clone
|
107
83
|
|
108
84
|
def cache_generator(self, key, generator):
|
109
85
|
results = []
|
@@ -114,28 +90,38 @@ class InferenceContext(object):
|
|
114
90
|
self.infered[key] = tuple(results)
|
115
91
|
return
|
116
92
|
|
93
|
+
@contextmanager
|
94
|
+
def restore_path(self):
|
95
|
+
path = set(self.path)
|
96
|
+
yield
|
97
|
+
self.path = path
|
117
98
|
|
118
|
-
def
|
99
|
+
def copy_context(context):
|
100
|
+
if context is not None:
|
101
|
+
return context.clone()
|
102
|
+
else:
|
103
|
+
return InferenceContext()
|
104
|
+
|
105
|
+
|
106
|
+
def _infer_stmts(stmts, context, frame=None):
|
119
107
|
"""return an iterator on statements inferred by each statement in <stmts>
|
120
108
|
"""
|
121
109
|
stmt = None
|
122
110
|
infered = False
|
123
|
-
if context is None:
|
111
|
+
if context is not None:
|
112
|
+
name = context.lookupname
|
113
|
+
context = context.clone()
|
114
|
+
else:
|
115
|
+
name = None
|
124
116
|
context = InferenceContext()
|
125
117
|
for stmt in stmts:
|
126
118
|
if stmt is YES:
|
127
119
|
yield stmt
|
128
120
|
infered = True
|
129
121
|
continue
|
130
|
-
|
131
|
-
kw = {}
|
132
|
-
infered_name = stmt._infer_name(frame, lookupname)
|
133
|
-
if infered_name is not None:
|
134
|
-
# only returns not None if .infer() accepts a lookupname kwarg
|
135
|
-
kw['lookupname'] = infered_name
|
136
|
-
|
122
|
+
context.lookupname = stmt._infer_name(frame, name)
|
137
123
|
try:
|
138
|
-
for infered in stmt.infer(context
|
124
|
+
for infered in stmt.infer(context):
|
139
125
|
yield infered
|
140
126
|
infered = True
|
141
127
|
except UnresolvableName:
|
@@ -197,12 +183,13 @@ class Instance(Proxy):
|
|
197
183
|
context = InferenceContext()
|
198
184
|
try:
|
199
185
|
# avoid recursively inferring the same attr on the same class
|
200
|
-
|
186
|
+
|
187
|
+
context.push((self._proxied, name))
|
201
188
|
# XXX frame should be self._proxied, or not ?
|
202
|
-
get_attr = self.getattr(name,
|
189
|
+
get_attr = self.getattr(name, context, lookupclass=False)
|
203
190
|
return _infer_stmts(
|
204
|
-
self._wrap_attr(get_attr,
|
205
|
-
|
191
|
+
self._wrap_attr(get_attr, context),
|
192
|
+
context,
|
206
193
|
frame=self,
|
207
194
|
)
|
208
195
|
except NotFoundError:
|
@@ -210,7 +197,7 @@ class Instance(Proxy):
|
|
210
197
|
# fallback to class'igetattr since it has some logic to handle
|
211
198
|
# descriptors
|
212
199
|
return self._wrap_attr(self._proxied.igetattr(name, context),
|
213
|
-
|
200
|
+
context)
|
214
201
|
except NotFoundError:
|
215
202
|
raise InferenceError(name)
|
216
203
|
|
@@ -301,9 +288,9 @@ class BoundMethod(UnboundMethod):
|
|
301
288
|
return True
|
302
289
|
|
303
290
|
def infer_call_result(self, caller, context):
|
304
|
-
|
305
|
-
|
306
|
-
|
291
|
+
context = context.clone()
|
292
|
+
context.boundnode = self.bound
|
293
|
+
return self._proxied.infer_call_result(caller, context)
|
307
294
|
|
308
295
|
|
309
296
|
class Generator(Instance):
|
@@ -335,8 +322,7 @@ def path_wrapper(func):
|
|
335
322
|
"""wrapper function handling context"""
|
336
323
|
if context is None:
|
337
324
|
context = InferenceContext()
|
338
|
-
context
|
339
|
-
|
325
|
+
context.push(node)
|
340
326
|
yielded = set()
|
341
327
|
for res in _func(node, context, **kwargs):
|
342
328
|
# unproxy only true instance, not const, tuple, dict...
|
@@ -409,7 +395,8 @@ class NodeNG(object):
|
|
409
395
|
if not context:
|
410
396
|
return self._infer(context, **kwargs)
|
411
397
|
|
412
|
-
key = (self,
|
398
|
+
key = (self, context.lookupname,
|
399
|
+
context.callcontext, context.boundnode)
|
413
400
|
if key in context.infered:
|
414
401
|
return iter(context.infered[key])
|
415
402
|
|