summaryrefslogtreecommitdiff
path: root/deps/v8/third_party/inspector_protocol/roll.py
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/third_party/inspector_protocol/roll.py')
-rwxr-xr-xdeps/v8/third_party/inspector_protocol/roll.py47
1 files changed, 23 insertions, 24 deletions
diff --git a/deps/v8/third_party/inspector_protocol/roll.py b/deps/v8/third_party/inspector_protocol/roll.py
index ee9c1d099e..abe636e270 100755
--- a/deps/v8/third_party/inspector_protocol/roll.py
+++ b/deps/v8/third_party/inspector_protocol/roll.py
@@ -18,6 +18,9 @@ FILES_TO_SYNC = [
'code_generator.py',
'concatenate_protocols.py',
'convert_protocol_to_json.py',
+ 'encoding/encoding.h',
+ 'encoding/encoding.cc',
+ 'encoding/encoding_test.cc',
'inspector_protocol.gni',
'inspector_protocol.gypi',
'lib/*',
@@ -95,11 +98,6 @@ def main(argv):
parser.add_argument("--v8_src_downstream",
help="The V8 src tree.",
default="~/v8/v8")
- parser.add_argument('--reverse', dest='reverse', action='store_true',
- help=("Whether to roll the opposite direction, from "
- "V8 (downstream) to inspector_protocol "
- "(upstream)."))
- parser.set_defaults(reverse=False)
parser.add_argument('--force', dest='force', action='store_true',
help=("Whether to carry out the modifications "
"in the destination tree."))
@@ -116,14 +114,9 @@ def main(argv):
# Check that the destination Git repo isn't at the master branch - it's
# generally a bad idea to check into the master branch, so we catch this
# common pilot error here early.
- if args.reverse:
- CheckRepoIsNotAtMasterBranch(upstream)
- src_dir = os.path.join(downstream, 'third_party/inspector_protocol')
- dest_dir = upstream
- else:
- CheckRepoIsNotAtMasterBranch(downstream)
- src_dir = upstream
- dest_dir = os.path.join(downstream, 'third_party/inspector_protocol')
+ CheckRepoIsNotAtMasterBranch(downstream)
+ src_dir = upstream
+ dest_dir = os.path.join(downstream, 'third_party/inspector_protocol')
print('Rolling %s into %s ...' % (src_dir, dest_dir))
src_files = set(FindFilesToSyncIn(src_dir))
dest_files = set(FindFilesToSyncIn(dest_dir))
@@ -143,20 +136,26 @@ def main(argv):
sys.exit(1)
print('You said --force ... as you wish, modifying the destination.')
for f in to_add + to_copy:
- shutil.copyfile(os.path.join(src_dir, f), os.path.join(dest_dir, f))
+ contents = open(os.path.join(src_dir, f)).read()
+ contents = contents.replace(
+ 'INSPECTOR_PROTOCOL_ENCODING_ENCODING_H_',
+ 'V8_INSPECTOR_PROTOCOL_ENCODING_ENCODING_H_')
+ contents = contents.replace(
+ 'namespace inspector_protocol_encoding',
+ 'namespace v8_inspector_protocol_encoding')
+ open(os.path.join(dest_dir, f), 'w').write(contents)
shutil.copymode(os.path.join(src_dir, f), os.path.join(dest_dir, f))
for f in to_delete:
os.unlink(os.path.join(dest_dir, f))
- if not args.reverse:
- head_revision = GetHeadRevision(upstream)
- lines = open(os.path.join(dest_dir, 'README.v8')).readlines()
- f = open(os.path.join(dest_dir, 'README.v8'), 'w')
- for line in lines:
- if line.startswith('Revision: '):
- f.write('Revision: %s' % head_revision)
- else:
- f.write(line)
- f.close()
+ head_revision = GetHeadRevision(upstream)
+ lines = open(os.path.join(dest_dir, 'README.v8')).readlines()
+ f = open(os.path.join(dest_dir, 'README.v8'), 'w')
+ for line in lines:
+ if line.startswith('Revision: '):
+ f.write('Revision: %s' % head_revision)
+ else:
+ f.write(line)
+ f.close()
if __name__ == '__main__':