Beispiel #1
0
  def FromDep(cls, dep):
    """Create a Commit from a Dep namedtuple as returned by Deps().

    If the repository url is unknown, it will be added to the local datastore.

    If the repository is on the exclusion list returns None.

    Arguments:
      dep: A Dep namedtuple.

    Returns:
      A Commit or None.
    """
    repository = repository_module.RepositoryName(
        dep.repository_url, add_if_missing=True)
    if repository in utils.GetRepositoryExclusions():
      return None
    commit = cls(repository, dep.git_hash)
    commit._repository_url = dep.repository_url
    return commit
Beispiel #2
0
def RepositoryInclusionFilter(commit):
  """Returns False for changes in repositories in the exclusion list."""
  return commit.repository not in utils.GetRepositoryExclusions()