| Index: tools/roll_pdfium.py
|
| diff --git a/tools/roll_angle.py b/tools/roll_pdfium.py
|
| similarity index 91%
|
| copy from tools/roll_angle.py
|
| copy to tools/roll_pdfium.py
|
| index 92323170631239bb16da2ad915d57447619bc6ed..2ac93bbaacba5c88a30548a3e758594328fea229 100755
|
| --- a/tools/roll_angle.py
|
| +++ b/tools/roll_pdfium.py
|
| @@ -27,12 +27,12 @@ upload.verbosity = 0 # Errors only.
|
| CHROMIUM_GIT_URL = 'https://chromium.googlesource.com/chromium/src.git'
|
| CL_ISSUE_RE = re.compile('^Issue number: ([0-9]+) \((.*)\)$')
|
| RIETVELD_URL_RE = re.compile('^https?://(.*)/(.*)')
|
| -ROLL_BRANCH_NAME = 'special_angle_roll_branch'
|
| +ROLL_BRANCH_NAME = 'special_pdfium_roll_branch'
|
| TRYJOB_STATUS_SLEEP_SECONDS = 30
|
|
|
| # Use a shell for subcommands on Windows to get a PATH search.
|
| IS_WIN = sys.platform.startswith('win')
|
| -ANGLE_PATH = os.path.join('third_party', 'angle')
|
| +PDFIUM_PATH = os.path.join('third_party', 'pdfium')
|
|
|
| CommitInfo = collections.namedtuple('CommitInfo', ['git_commit',
|
| 'git_repo_url'])
|
| @@ -71,7 +71,7 @@ def _ParseDepsDict(deps_content):
|
| return local_scope
|
|
|
|
|
| -def _GenerateCLDescriptionCommand(angle_current, angle_new, bugs):
|
| +def _GenerateCLDescriptionCommand(pdfium_current, pdfium_new, bugs):
|
| def GetChangeString(current_hash, new_hash):
|
| return '%s..%s' % (current_hash[0:7], new_hash[0:7]);
|
|
|
| @@ -84,14 +84,14 @@ def _GenerateCLDescriptionCommand(angle_current, angle_new, bugs):
|
| bug_str += str(bug) + ','
|
| return bug_str.rstrip(',')
|
|
|
| - if angle_current.git_commit != angle_new.git_commit:
|
| - change_str = GetChangeString(angle_current.git_commit,
|
| - angle_new.git_commit)
|
| - changelog_url = GetChangeLogURL(angle_current.git_repo_url,
|
| + if pdfium_current.git_commit != pdfium_new.git_commit:
|
| + change_str = GetChangeString(pdfium_current.git_commit,
|
| + pdfium_new.git_commit)
|
| + changelog_url = GetChangeLogURL(pdfium_current.git_repo_url,
|
| change_str)
|
|
|
| return [
|
| - '-m', 'Roll ANGLE ' + change_str,
|
| + '-m', 'Roll PDFium ' + change_str,
|
| '-m', '%s' % changelog_url,
|
| '-m', GetBugString(bugs),
|
| '-m', 'TEST=bots',
|
| @@ -173,11 +173,11 @@ class AutoRoller(object):
|
| logging.debug('Dirty/unversioned files:\n%s', '\n'.join(lines))
|
| return False
|
|
|
| - def _GetBugList(self, path_below_src, angle_current, angle_new):
|
| + def _GetBugList(self, path_below_src, pdfium_current, pdfium_new):
|
| working_dir = os.path.join(self._chromium_src, path_below_src)
|
| lines = self._RunCommand(
|
| ['git','log',
|
| - '%s..%s' % (angle_current.git_commit, angle_new.git_commit)],
|
| + '%s..%s' % (pdfium_current.git_commit, pdfium_new.git_commit)],
|
| working_dir=working_dir).split('\n')
|
| bugs = set()
|
| for line in lines:
|
| @@ -190,7 +190,7 @@ class AutoRoller(object):
|
| bugs.add(int(bug_string))
|
| except:
|
| # skip this, it may be a project specific bug such as
|
| - # "angleproject:X" or an ill-formed BUG= message
|
| + # "pdfium:X" or an ill-formed BUG= message
|
| pass
|
| return bugs
|
|
|
| @@ -229,24 +229,24 @@ class AutoRoller(object):
|
| # Parse current hashes.
|
| deps_filename = os.path.join(self._chromium_src, 'DEPS')
|
| deps = _ParseDepsFile(deps_filename)
|
| - angle_current = self._GetDepsCommitInfo(deps, ANGLE_PATH)
|
| + pdfium_current = self._GetDepsCommitInfo(deps, PDFIUM_PATH)
|
|
|
| # Find ToT revisions.
|
| - angle_latest = self._GetCommitInfo(ANGLE_PATH)
|
| + pdfium_latest = self._GetCommitInfo(PDFIUM_PATH)
|
|
|
| if IS_WIN:
|
| # Make sure the roll script doesn't use windows line endings
|
| self._RunCommand(['git', 'config', 'core.autocrlf', 'true'])
|
|
|
| - self._UpdateDep(deps_filename, ANGLE_PATH, angle_latest)
|
| + self._UpdateDep(deps_filename, PDFIUM_PATH, pdfium_latest)
|
|
|
| if self._IsTreeClean():
|
| logging.debug('Tree is clean - no changes detected.')
|
| self._DeleteRollBranch()
|
| else:
|
| - bugs = self._GetBugList(ANGLE_PATH, angle_current, angle_latest)
|
| + bugs = self._GetBugList(PDFIUM_PATH, pdfium_current, pdfium_latest)
|
| description = _GenerateCLDescriptionCommand(
|
| - angle_current, angle_latest, bugs)
|
| + pdfium_current, pdfium_latest, bugs)
|
| logging.debug('Committing changes locally.')
|
| self._RunCommand(['git', 'add', '--update', '.'])
|
| self._RunCommand(['git', 'commit'] + description)
|
| @@ -315,7 +315,7 @@ class AutoRoller(object):
|
|
|
| def main():
|
| parser = argparse.ArgumentParser(
|
| - description='Auto-generates a CL containing an ANGLE roll.')
|
| + description='Auto-generates a CL containing an PDFium roll.')
|
| parser.add_argument('--abort',
|
| help=('Aborts a previously prepared roll. '
|
| 'Closes any associated issues and deletes the roll branches'),
|
|
|