def AddRepositoryTags(prefix='', rid=True, date=True, revision=True,
                      wrap=False):
  """Add repository tagging into the output.

  Args:
    prefix: comment delimiter, if needed, to appear before tags
    rid: bool; True includes the revision Id: repository tag.
    date: bool; True includes the Date: repository tag.
    revision: bool; True includes the Revision: repository tag.
    wrap: bool; True wraps the tag in double quotes.
  Returns:
    list of text lines containing revision data
  """
  tags = []
  wrapper = '"' if wrap else ''

  # Format print the '$' into the RCS tags in order prevent the tags from
  # being interpolated here.
  p4_id = '%s%sId:%s%s' % (wrapper, '$', '$', wrapper)
  p4_date = '%s%sDate:%s%s' % (wrapper, '$', '$', wrapper)
  p4_revision = '%s%sRevision:%s%s' % (wrapper, '$', '$', wrapper)
  if rid:
    tags.append('%s%s' % (prefix, p4_id))
  if date:
    tags.append('%s%s' % (prefix, p4_date))
  if revision:
    tags.append('%s%s' % (prefix, p4_revision))
  return tags