Package com.google.gerrit.server.git

Examples of com.google.gerrit.server.git.ProjectConfig


        MetaDataUpdate md =
            new MetaDataUpdate(GitReferenceUpdated.DISABLED, name, git);
        md.getCommitBuilder().setAuthor(serverUser);
        md.getCommitBuilder().setCommitter(serverUser);

        ProjectConfig config = ProjectConfig.read(md);

        // Update the existing refences to the new reference.
        boolean updated = false;
        for (Map.Entry<AccountGroup.UUID, GroupReference> entry: ldapUUIDMap.entrySet()) {
          GroupReference ref = config.getGroup(entry.getKey());
          if (ref != null) {
            updated = true;
            ref.setName(entry.getValue().getName());
            ref.setUUID(entry.getValue().getUUID());
            config.resolve(ref);
          }
        }

        // Determine if a toResolve group is used and should be made INTERNAL.
        Iterator<AccountGroup.UUID> iter = toResolve.iterator();
        while (iter.hasNext()) {
          AccountGroup.UUID uuid = iter.next();
          if (config.getGroup(uuid) != null) {
            resolveToUpdate.add(uuid);
            iter.remove();
          }
        }

        if (!updated) {
          continue;
        }

        md.setMessage("Switch LDAP group UUIDs to DNs\n");
        config.commit(md);
      } catch (IOException e) {
        throw new OrmException(e);
      } catch (ConfigInvalidException e) {
        throw new OrmException(e);
      } finally {
View Full Code Here


  @Override
  public void setUp() throws Exception {
    super.setUp();

    parent = new ProjectConfig(new Project.NameKey("parent"));
    parent.createInMemory();

    local = new ProjectConfig(new Project.NameKey("local"));
    local.createInMemory();
    local.getProject().setParentName(parent.getProject().getName());

    Cache<SectionSortCache.EntryKey, SectionSortCache.EntryVal> c =
        CacheBuilder.newBuilder().build();
View Full Code Here

      }

      try {
        MetaDataUpdate md = metaDataUpdateFactory.create(nameKey);
        try {
          ProjectConfig config = ProjectConfig.read(md);
          config.getProject().setParentName(newParentKey);
          md.setMessage("Inherit access from "
              + (newParentKey != null ? newParentKey.get() : allProjectsName.get()) + "\n");
          config.commit(md);
        } finally {
          md.close();
        }
      } catch (RepositoryNotFoundException notFound) {
        err.append("error: Project " + name + " not found\n");
View Full Code Here

    final StringBuilder err = new StringBuilder();

    try {
      MetaDataUpdate md = metaDataUpdateFactory.create(nameKey);
      try {
        ProjectConfig config = ProjectConfig.read(md);
        Project project = config.getProject();

        project.setRequireChangeID(requireChangeID != null ? requireChangeID
            : project.isRequireChangeID());

        project.setRequireChangeID(noRequireChangeID != null
            ? !noRequireChangeID : project.isRequireChangeID());

        project.setSubmitType(submitType != null ? submitType : project
            .getSubmitType());

        project.setUseContentMerge(contentMerge != null ? contentMerge
            : project.isUseContentMerge());

        project.setUseContentMerge(noContentMerge != null ? !noContentMerge
            : project.isUseContentMerge());

        project.setUseContributorAgreements(contributorAgreements != null
            ? contributorAgreements : project.isUseContributorAgreements());

        project.setUseContributorAgreements(noContributorAgreements != null
            ? !noContributorAgreements : project.isUseContributorAgreements());

        project.setUseSignedOffBy(signedOffBy != null ? signedOffBy : project
            .isUseSignedOffBy());

        project.setUseContentMerge(noSignedOffBy != null ? !noSignedOffBy
            : project.isUseContentMerge());

        project.setDescription(projectDescription != null ? projectDescription
            : project.getDescription());

        project.setState(state != null ? state : project.getState());

        md.setMessage("Project settings updated");
        config.commit(md);
      } finally {
        md.close();
      }
    } catch (RepositoryNotFoundException notFound) {
      err.append("error: Project " + name + " not found\n");
View Full Code Here

TOP

Related Classes of com.google.gerrit.server.git.ProjectConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.