'Add a repository to the namespace and path indexes.
Checks for duplicates -- two repos can\'t have the same root
directory, and they provide have the same namespace.'

def _add(self, repo):

    if (repo.root in self.by_path):
        raise DuplicateRepoError(("Duplicate    repository:    '%s'" % repo.root))
    if (repo.namespace in self.by_namespace):
        raise DuplicateRepoError(("Package    repos    '%s'    and    '%s'    both    provide    namespace    %s" % (repo.root, self.by_namespace[repo.namespace].root, repo.namespace)))
    self.by_namespace[repo.full_namespace] = repo
    self.by_path[repo.root] = repo
