def CheckEnforcedChanges(input_api, output_api, committing, enforced):
  """Enforces changes based on the provided rules.

  |enforced| is a list of 2-tuples, where each entry is a list of file
  names relative to the repository root. If all of the files in
  the first list have been changed, then all of the files in the second
  list must also be changed.
  """

  errors = []

  changed = {}
  for f in input_api.AffectedFiles(include_deletes=False):
    changed[f.LocalPath()] = True

  for (a, b) in enforced:
    all_changed = all(changed.get(f, False) for f in a)
    if not all_changed:
      continue

    for f in b:
      if f not in changed:
        errors.append(output_api.PresubmitPromptWarning(
            '%s needs to be updated.' % f))

  return errors