Examples of unsetSection()


Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

    }
    Repository db = null;
    try {
      db = repositoryManager.getRepository(repository.name);
      StoredConfig config = db.getConfig();
      config.unsetSection(LABEL, label);
      config.save();

      return true;
    } catch (IOException e) {
      log.error("failed to delete label " + label + " in " + repository, e);
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

    // User Defined Properties
    if (repository.customFields != null) {
      if (repository.customFields.size() == 0) {
        // clear section
        config.unsetSection(Constants.CONFIG_GITBLIT, Constants.CONFIG_CUSTOM_FIELDS);
      } else {
        for (Entry<String, String> property : repository.customFields.entrySet()) {
          // set field
          String key = property.getKey();
          String value = property.getValue();
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

      TicketMilestone tm = getMilestone(repository, oldName);
      if (tm == null) {
        return false;
      }
      StoredConfig config = db.getConfig();
      config.unsetSection(MILESTONE, oldName);
      config.setString(MILESTONE, newName, STATUS, tm.status.name());
      config.setString(MILESTONE, newName, COLOR, tm.color);
      if (tm.due != null) {
        config.setString(MILESTONE, newName, DUE,
            new SimpleDateFormat(DUE_DATE_PATTERN).format(tm.due));
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

      if (tm == null) {
        return false;
      }
      db = repositoryManager.getRepository(repository.name);
      StoredConfig config = db.getConfig();
      config.unsetSection(MILESTONE, milestone);
      config.save();

      milestonesCache.remove(repository.name);

      TicketNotifier notifier = createNotifier();
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

    try {
      StoredConfig config = getConfig();
      if (!StringUtils.isEmpty(name) && !name.equals(reg.name)) {
        // delete old registration
        registrations.remove(name);
        config.unsetSection(SERVER, name);
      }

      // update registration
      config.setString(SERVER, reg.name, "url", reg.url);
      config.setString(SERVER, reg.name, "account", reg.account);
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

  public boolean deleteRegistrations(List<GitblitRegistration> list) {
    boolean success = false;
    try {
      StoredConfig config = getConfig();
      for (GitblitRegistration reg : list) {
        config.unsetSection(SERVER, reg.name);
        registrations.remove(reg.name);
      }
      config.save();
      success = true;
    } catch (Throwable t) {
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

  @Before
  public void initializeConfiguration() throws Exception{
    Repository r = GitBlitSuite.getHelloworldRepository();
    StoredConfig config = r.getConfig();

    config.unsetSection(Constants.CONFIG_GITBLIT, Constants.CONFIG_CUSTOM_FIELDS);
    config.setString(Constants.CONFIG_GITBLIT, Constants.CONFIG_CUSTOM_FIELDS, "commitMessageRegEx", "\\d");
    config.setString(Constants.CONFIG_GITBLIT, Constants.CONFIG_CUSTOM_FIELDS, "anotherProperty", "Hello");

    config.save();
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

  @After
  public void teardownConfiguration() throws Exception {
    Repository r = GitBlitSuite.getHelloworldRepository();
    StoredConfig config = r.getConfig();

    config.unsetSection(Constants.CONFIG_GITBLIT, Constants.CONFIG_CUSTOM_FIELDS);
    config.save();
  }

  @Test
  public void testGetCustomProperty() throws Exception {
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

          if (fullName.startsWith(Constants.R_HEADS)) {
            String shortenedName = fullName
                .substring(Constants.R_HEADS.length());
            // remove upstream configuration if any
            final StoredConfig cfg = repo.getConfig();
            cfg.unsetSection(
                ConfigConstants.CONFIG_BRANCH_SECTION,
                shortenedName);
            cfg.save();
          }
        } else
View Full Code Here

Examples of org.eclipse.jgit.lib.StoredConfig.unsetSection()

  }

  @Test
  public void renameBranchNoConfigValues() throws Exception {
    StoredConfig config = git.getRepository().getConfig();
    config.unsetSection(ConfigConstants.CONFIG_BRANCH_SECTION,
        Constants.MASTER);
    config.save();

    String branch = "b1";
    assertTrue(config.getNames(ConfigConstants.CONFIG_BRANCH_SECTION,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.