adds local repository
489124
private Settings enrichWithLocalRepository(Settings settings) {

        // set default value if not set at all
        if (settings.getLocalRepository() == null || settings.getLocalRepository().length() == 0) {
            settings.setLocalRepository(DEFAULT_REPOSITORY_PATH);
        }

        // override any value with system property based location
        String altLocalRepository = SecurityActions.getProperty(ALT_LOCAL_REPOSITORY_LOCATION);
        if (altLocalRepository != null && altLocalRepository.length() > 0) {
            settings.setLocalRepository(altLocalRepository);
        }
        return settings;
    }
848393
public void addRemoteRepositoryByUrl(String url) throws NaetherException {
        try {
            addRemoteRepository(RepoBuilder.remoteRepositoryFromUrl(url));
        } catch (MalformedURLException e) {
            log.error( "Malformed url: {}", url, e);
            throw new NaetherException(e);
        }
    }
1101648
def enable_apt_repositories(prefix, url, version, repositories):
    
    with settings(hide('warnings', 'running', 'stdout'),
                  warn_only=False, capture=True):
        sudo('apt-add-repository "%s %s %s %s"' % (prefix,
                                                   url,
                                                   version,
                                                   repositories))
        with hide('running', 'stdout'):
            output = sudo("DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get update")
        if 'Some index files failed to download' in output:
            raise SystemExit(1)
        else:
            # if we didn't abort above, we should return True
            return True
292588
def add_repo(self, repo_name, items):
        
        juicer.utils.Log.log_debug("[CART:%s] Adding %s items to repo '%s'" % \
                                       (self.cart_name, len(items), repo_name))
        # We can't just straight-away add all of `items` to the
        # repo. `items` may be composed of a mix of local files, local
        # directories, remote files, and remote directories. We need
        # to filter and validate each item.
        items = juicer.utils.filter_package_list(items)
        cart_items = []
        for item in items:
            juicer.utils.Log.log_debug("Creating CartObject for %s" % item)
            i = juicer.common.CartItem.CartItem(item)
            cart_items.append(i)
        self.repo_items_hash[repo_name] = cart_items
382121
private void addRepository(String repositoryId, RepositoryWrapper repositoryHolder) {
        repositories.put(repositoryId, repositoryHolder);
        try {
            numRepos = getNumberOfRepositories();
        } catch (WIMException e) {
            // okay
        }
    }
1023636
public void addRepository(Repository repo) throws GreenPepperServerException
    {
        if (findRepositoryByName(repo.getName()) != null)
        {
            throw new GreenPepperServerException( GreenPepperServerErrorKey.REPOSITORY_ALREADY_EXISTS, "Repository already exists");
        }

        repo.setProject(this);
        repositories.add(repo);
    }
876531
def repository(self, only):
        
        print("\nCheck and update repositories:\n")
        default = self.meta.default_repositories
        enabled = self.meta.repositories
        if only:
            enabled = only
        for repo in enabled:
            if check_for_local_repos(repo) is True:
                continue
            sys.stdout.write("{0}Check repository [{1}{2}{3}] ... "
                             "{4}".format(
                                    self.meta.color["GREY"],
                                    self.meta.color["CYAN"], repo,
                                    self.meta.color["GREY"],
                                    self.meta.color["ENDC"]))
            sys.stdout.flush()
            if repo in default:
                exec("{0}.{1}()".format(self._init, repo))
                sys.stdout.write(self.done)
            elif repo in enabled:
                Initialization(False).custom(repo)
                sys.stdout.write(self.done)
            else:
                sys.stdout.write(self.error)
        print("")   # new line at end
        raise SystemExit()
223361
public void addArtifact(SessionProvider sp, ArtifactDescriptor artifact, InputStream jarIStream,
            InputStream pomIStream) throws RepositoryException
   {

      Session session = currentSession(sp);
      Node rootNode = (Node) session.getItem(rootNodePath);

      Node groupId_tail = createGroupIdLayout(rootNode, artifact);

      Node artifactId_node = createArtifactIdLayout(groupId_tail, artifact);

      Node version_node = createVersionLayout(artifactId_node, artifact);

      if (version_node != null)
      { // returns if the same node sibling appears
         importResource(version_node, jarIStream, "jar", artifact);
         importResource(version_node, pomIStream, "pom", artifact);
      }

      session.save();

   }
1080300
def ppa(state, host, name, present=True):
    '''
    
    '''

    if present:
        yield 'apt-add-repository -y "{0}"'.format(name)

    if not present:
        yield 'apt-add-repository -y --remove "{0}"'.format(name)
1203560
public function addRepositories(array $repositories)
    {
        foreach ($repositories as $name => $repository) {
            $this->addRepository($repository, (is_string($name) ? $name : null));
        }
    }
596488
def add_remote_repository( url, username = nil, password = nil )
      if username
        @resolver.addRemoteRepositoryByUrl( url, username, password )
      else
        @resolver.addRemoteRepositoryByUrl( url )
      end
    end
373899
function addContentsDirectoryToReaddirResultAndCallOriginalCallback(err, entryNames) {
                                if (!err && Array.isArray(entryNames)) {
                                    entryNames = ['gitFakeFs'].concat(entryNames);
                                }
                                cb.call(this, err, entryNames);
                            }
517599
public function addRepository($repository)
    {
        $class = $repository->getModelClass();
        if ($this->getByClass($class)) {
            throw new RepositoryException("The manager already contains a repository for the model class '$class'");
        }
        
        $repository->setManager($this);
        $this->repositories[$class] = $repository;
    }
595652
def add(self, snapshot, distributions, component='main', storage=""):
        
        for dist in distributions:
            self.publish(dist, storage=storage).add(snapshot, component)
169305
async function initRepo({
  repository,
  endpoint,
  gitPrivateKey,
  gitFs,
  localDir,
}) {
  logger.debug(
    `initRepo("${JSON.stringify(
      { repository, endpoint, gitFs, localDir },
      null,
      2
    )}")`
  );
  const opts = hostRules.find({ platform }, { endpoint });
  // istanbul ignore if
  if (!(opts.username && opts.password)) {
    throw new Error(
      `No username/password found for Bitbucket repository ${repository}`
    );
  }
  // istanbul ignore if
  if (!opts.endpoint) {
    throw new Error(`No endpoint found for Bitbucket Server`);
  }
  hostRules.update({ ...opts, platform, default: true });
  api.reset();

  const [projectKey, repositorySlug] = repository.split('/');
  config = { projectKey, repositorySlug, gitPrivateKey };

  // Always gitFs
  const { host, pathname } = url.parse(opts.endpoint);
  const gitUrl = GitStorage.getUrl({
    gitFs: gitFs || 'https',
    auth: `${opts.username}:${opts.password}`,
    host: `${host}${pathname}${pathname.endsWith('/') ? '' : '/'}scm`,
    repository,
  });

  config.storage = new GitStorage();
  await config.storage.initRepo({
    ...config,
    localDir,
    url: gitUrl,
  });

  const platformConfig = {};

  try {
    const info = (await api.get(
      `./rest/api/1.0/projects/${config.projectKey}/repos/${
        config.repositorySlug
      }`
    )).body;
    platformConfig.privateRepo = info.is_private;
    platformConfig.isFork = !!info.parent;
    platformConfig.repoFullName = info.name;
    config.owner = info.project.key;
    logger.debug(`${repository} owner = ${config.owner}`);
    config.defaultBranch = (await api.get(
      `./rest/api/1.0/projects/${config.projectKey}/repos/${
        config.repositorySlug
      }/branches/default`
    )).body.displayId;
    config.baseBranch = config.defaultBranch;
    config.mergeMethod = 'merge';
  } catch (err) /* istanbul ignore next */ {
    logger.debug(err);
    if (err.statusCode === 404) {
      throw new Error('not-found');
    }
    logger.info({ err }, 'Unknown Bitbucket initRepo error');
    throw err;
  }
  delete config.prList;
  delete config.fileList;
  logger.debug(
    { platformConfig },
    `platformConfig for ${config.projectKey}/${config.repositorySlug}`
  );
  return platformConfig;
}
1101301
public Git cloneRepository(String remoteUrl, Path localPath) {
        try {
            return Git.cloneRepository()
                .setURI(remoteUrl)
                .setDirectory(localPath.toFile())
                .call();
        } catch (GitAPIException e) {
            throw new IllegalStateException(e);
        }
    }
1195824
function _createRepository() {
        return co(function*(){
            try {
                debug("Creating a new one");
                let repo = yield nodegit.Repository.init(repositoryPath, 0);
                debug("Connection established");
                debug("Creating main files");
                yield _createManifest(repo);
                yield _createConfig(repo);
                fs.mkdirSync(machinesDirPath);
                yield _commit(repo, ["manifest.json", "config.json"]);
                debug("Repository was successfully created");
                return repo;
            } catch (err) {
                debug(err);
                debug("Nuking the repository");
                yield new Promise(function(resolve, reject) {
                    rimraf(repositoryPath, function () {
                        resolve();
                    });
                }).then();
                throw new Error(err);
            }
        });
    }