def move(self, apply_only=None): """Move Blink source files. Args: apply_only: If it's None, move all affected files. Otherwise, it should be a set of file paths and this function moves only the files in |apply_only|. """ _log.info('Planning renaming ...') file_pairs = plan_blink_move(self._fs, []) if apply_only: file_pairs = [(src, dest) for (src, dest) in file_pairs if 'third_party/WebKit/' + src.replace('\\', '/') in apply_only] print 'Update file_pairs = ', file_pairs _log.info('Will move %d files', len(file_pairs)) git = Git(cwd=self._repo_root) files_set = self._get_checked_in_files(git) for i, (src, dest) in enumerate(file_pairs): src_from_repo = self._fs.join('third_party', 'WebKit', src) if src_from_repo.replace('\\', '/') not in files_set: _log.info('%s is not in the repository', src) continue dest_from_repo = self._fs.join('third_party', 'blink', dest) self._fs.maybe_make_directory(self._repo_root, 'third_party', 'blink', self._fs.dirname(dest)) if self._options.run_git: git.move(src_from_repo, dest_from_repo) _log.info('[%d/%d] Git moved %s', i + 1, len(file_pairs), src) else: self._fs.move(self._fs.join(self._repo_root, src_from_repo), self._fs.join(self._repo_root, dest_from_repo)) _log.info('[%d/%d] Moved %s', i + 1, len(file_pairs), src) if apply_only: return self._update_single_file_content( 'build/get_landmines.py', [('\ndef main', ' print \'The Great Blink mv for source files (crbug.com/768828)\'\n\ndef main')]) _log.info('Run run-bindings-tests ...') Executive().run_command(['python', self._fs.join(get_scripts_dir(), 'run-bindings-tests'), '--reset-results'], cwd=self._repo_root) if self._options.run_git: _log.info('Make a local commit ...') git.commit_locally_with_message("""The Great Blink mv for source files, part 2. Move and rename files. NOAUTOREVERT=true Bug: 768828 """)
def move(self): _log.info('Planning renaming ...') file_pairs = plan_blink_move(self._fs, []) _log.info('Will move %d files', len(file_pairs)) git = Git(cwd=self._repo_root) files_set = self._get_checked_in_files(git) for i, (src, dest) in enumerate(file_pairs): src_from_repo = self._fs.join('third_party', 'WebKit', src) if src_from_repo.replace('\\', '/') not in files_set: _log.info('%s is not in the repository', src) continue dest_from_repo = self._fs.join('third_party', 'blink', dest) self._fs.maybe_make_directory(self._repo_root, 'third_party', 'blink', self._fs.dirname(dest)) if self._options.run_git: git.move(src_from_repo, dest_from_repo) _log.info('[%d/%d] Git moved %s', i + 1, len(file_pairs), src) else: self._fs.move(self._fs.join(self._repo_root, src_from_repo), self._fs.join(self._repo_root, dest_from_repo)) _log.info('[%d/%d] Moved %s', i + 1, len(file_pairs), src) self._update_single_file_content('build/get_landmines.py', [( '\ndef main', ' print \'The Great Blink mv for source files (crbug.com/768828)\'\n\ndef main' )]) _log.info('Run run-bindings-tests ...') Executive().run_command([ 'python', self._fs.join(get_scripts_dir(), 'run-bindings-tests'), '--reset-results' ], cwd=self._repo_root) if self._options.run_git: _log.info('Make a local commit ...') git.commit_locally_with_message( """The Great Blink mv for source files, part 2. Move and rename files. Bug: 768828 """)