message: Sort the redirects list so the output is consistent from run to run.
diff: @@ -97,7 +97,7 @@ def write_docs(output_dir,
  symbol_to_file = {}
  # Collect redirects for an api _redirects.yaml file.
  - redirects = ['redirects:\n']
  + redirects = []
  # Parse and write Markdown pages, resolving cross-links (@{symbol}).
  for full_name, py_object in six.iteritems(parser_config.index):
  @@ -166,17 +166,20 @@ def write_docs(output_dir,
  continue
  duplicates = [item for item in duplicates if item != full_name]
  - template = ('- from: /{}\n'
  - ' to: /{}\n')
  +
  for dup in duplicates:
  from_path = os.path.join(site_api_path, dup.replace('.', '/'))
  to_path = os.path.join(site_api_path, full_name.replace('.', '/'))
  - redirects.append(
  - template.format(from_path, to_path))
  + redirects.append((from_path, to_path))
  - if site_api_path:
  + if site_api_path and redirects:
  + redirects = sorted(redirects)
  + template = ('- from: /{}\n'
  + ' to: /{}\n')
  + redirects = [template.format(f, t) for f, t in redirects]
  api_redirects_path = os.path.join(output_dir, '_redirects.yaml')
  with open(api_redirects_path, 'w') as redirect_file:
  + redirect_file.write('redirects:\n')
  redirect_file.write(''.join(redirects))
  if yaml_toc:
  