Examples of Commit


Examples of org.apache.jackrabbit.mongomk.api.model.Commit

    public void testSimpleRemove() throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append("-\"a\"");
        // TODO properties

        Commit commit = this.buildAndAssertCommit(sb.toString());

        List<Instruction> instructions = commit.getInstructions();
        assertEquals(1, instructions.size());
        InstructionAssert.assertRemoveNodeInstruction((RemoveNodeInstruction) instructions.get(0), "/a");
    }
View Full Code Here

Examples of org.apache.jackrabbit.vault.vlt.actions.Commit

        File localDir = app.getPlatformFile("", true);

        VltContext vCtx = app.createVaultContext(localDir);
        vCtx.setVerbose(cl.hasOption(OPT_VERBOSE));
        vCtx.setQuiet(cl.hasOption(OPT_QUIET));
        Commit s = new Commit(localDir,
                localFiles,
                cl.hasOption(optNonRecursive),
                cl.hasOption(optForce));
        vCtx.execute(s);
    }
View Full Code Here

Examples of org.eclipse.egit.core.synchronize.GitCommitsModelCache.Commit

  }

  private String createChangeSetLabel(GitModelCommit commitModel) {
    String format = store.getString(UIPreferences.SYNC_VIEW_CHANGESET_LABEL_FORMAT);

    Commit commit = commitModel.getCachedCommitObj();
    Map<String, String> bindings = new HashMap<String, String>();
    bindings.put(BINDING_CHANGESET_DATE, DATE_FORMAT.format(commit.getCommitDate()));
    bindings.put(BINDING_CHANGESET_AUTHOR, commit.getAuthorName());
    bindings.put(BINDING_CHANGESET_COMMITTER, commit.getCommitterName());
    bindings.put(BINDING_CHANGESET_SHORT_MESSAGE, commit.getShortMessage());

    return formatName(format, bindings);
  }
View Full Code Here

Examples of org.eclipse.egit.github.core.Commit

      throw new MojoExecutionException("Error creating tree: "
          + getExceptionMessage(e), e);
    }

    // Build commit
    Commit commit = new Commit();
    commit.setMessage(message);
    commit.setTree(tree);

    // Set parent commit SHA-1 if reference exists
    if (ref != null)
      commit.setParents(Collections.singletonList(new Commit().setSha(ref
          .getObject().getSha())));

    Commit created;
    try {
      if (!dryRun)
        created = service.createCommit(repository, commit);
      else
        created = new Commit();
      info(MessageFormat.format("Creating commit with SHA-1: {0}",
          created.getSha()));
    } catch (IOException e) {
      throw new MojoExecutionException("Error creating commit: "
          + getExceptionMessage(e), e);
    }

    TypedResource object = new TypedResource();
    object.setType(TYPE_COMMIT).setSha(created.getSha());
    if (ref != null) {
      // Update existing reference
      ref.setObject(object);
      try {
        info(MessageFormat.format(
            "Updating reference {0} from {1} to {2}", branch,
            commit.getParents().get(0).getSha(), created.getSha()));
        if (!dryRun)
          service.editReference(repository, ref, force);
      } catch (IOException e) {
        throw new MojoExecutionException("Error editing reference: "
            + getExceptionMessage(e), e);
      }
    } else {
      // Create new reference
      ref = new Reference().setObject(object).setRef(branch);
      try {
        info(MessageFormat.format(
            "Creating reference {0} starting at commit {1}",
            branch, created.getSha()));
        if (!dryRun)
          service.createReference(repository, ref);
      } catch (IOException e) {
        throw new MojoExecutionException("Error creating reference: "
            + getExceptionMessage(e), e);
View Full Code Here

Examples of org.eclipse.egit.github.core.Commit

    // Write tree
    Tree tree = createTree(service, repository, ref, entries);

    // Build commit
    Commit commit = new Commit();
    commit.setMessage(message != null ? message : "GitHubWagon: Deploying OpooPress to GitHub Pages.");
    commit.setTree(tree);

    // Set parent commit SHA-1 if reference exists
    if (ref != null){
      commit.setParents(Collections.singletonList(new Commit().setSha(ref.getObject().getSha())));
    }

    Commit created;
    try {
      created = service.createCommit(repository, commit);
      log.info(MessageFormat.format("Creating commit with SHA-1: {0}", created.getSha()));
    } catch (IOException e) {
      throw new GitHubException("Error creating commit: " + e.getMessage(), e);
    }

    TypedResource object = new TypedResource();
    object.setType(TYPE_COMMIT).setSha(created.getSha());
    if (ref != null) {
      // Update existing reference
      ref.setObject(object);
      try {
        log.info(String.format("Updating reference %s from %s to %s", branch, commit.getParents().get(0).getSha(), created.getSha()));
        service.editReference(repository, ref, force);
      } catch (IOException e) {
        throw new GitHubException("Error editing reference: " + e.getMessage(), e);
      }
    } else {
      // Create new reference
      ref = new Reference().setObject(object).setRef(branch);
      try {
        log.info(MessageFormat.format("Creating reference {0} starting at commit {1}", branch, created.getSha()));
        service.createReference(repository, ref);
      } catch (IOException e) {
        throw new GitHubException("Error creating reference: " + e.getMessage(), e);
      }
    }
View Full Code Here

Examples of org.eclipse.jgit.lib.Commit

        .getObjectId(0));
  }

  private ObjectId commit(final ObjectInserter odi, final DirCache treeB,
      final ObjectId[] parentIds) throws Exception {
    final Commit c = new Commit(db);
    c.setTreeId(treeB.writeTree(odi));
    c.setAuthor(new PersonIdent("A U Thor", "a.u.thor", 1L, 0));
    c.setCommitter(c.getAuthor());
    c.setParentIds(parentIds);
    c.setMessage("Tree " + c.getTreeId().name());
    ObjectId id = odi.insert(OBJ_COMMIT, odi.format(c));
    odi.flush();
    return id;
  }
View Full Code Here

Examples of org.eclipse.orion.server.git.objects.Commit

    RevWalk walk = new RevWalk(db);
    walk.setTreeFilter(AndTreeFilter.create(PathFilterGroup.createFromStrings(Collections.singleton(pattern)), TreeFilter.ANY_DIFF));
    RevCommit revCommit = walk.parseCommit(refId);
    walk.dispose();

    Commit commit = new Commit(null /* not needed */, db, revCommit, pattern);
    ObjectStream stream = commit.toObjectStream();
    if (stream == null) {
      String msg = NLS.bind("Commit body for ref {0} not found", ref);
      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND, msg, null));
    }
    IOUtilities.pipe(stream, response.getOutputStream(), true, false);
View Full Code Here

Examples of org.hivedb.teamcity.plugin.Commit

   
    Collection<Commit> commits = new ArrayList<Commit>();
    BufferedReader r = new BufferedReader(new StringReader(log));
    try {
      String line;
      Commit current = new Commit();
      while ((line = r.readLine()) != null) {
        if (line == null || line.trim().equals(""))
          continue;
        else {
          if (line.startsWith("commit")) {
            if (current.isValid()) {
              commits.add(current);
              current = new Commit();
            }
            current.setHash(line.replaceAll("commit", "").trim());
          }
          else if (line.startsWith("Author"))
            current.setAuthor(line.replaceAll("Author:", "").trim());
          else if (line.startsWith("Date")) {
            String dateString = line.replaceAll("Date:", "").trim();
            current.setDate(Constants.GIT_DATE.parse(dateString));
          }
          else if (line.startsWith("    ")) {
            current.setMessage(current.getMessage() + "\n" + line);
          }
          else {
            Matcher m = nameAndStatus.matcher(line);
            while (m.find()) {
              NameAndStatus change = new NameAndStatus(m.group(2), m.group(1));
              current.getChanges().add(change);
            }
          }
        }
      }
      if (current.isValid()) {
        commits.add(current);
      }
    }
    catch (IOException e) {
      throw new RuntimeException(e);
View Full Code Here

Examples of org.infinispan.loaders.modifications.Commit

      enqueue(prepare, prepare);
   }

   @Override
   public void commit(GlobalTransaction tx) throws CacheLoaderException {
      Commit commit = new Commit(tx);
      enqueue(commit, commit);
   }
View Full Code Here

Examples of org.kohsuke.github.GHPullRequestCommitDetail.Commit

    given(committer.getName()).willReturn(this.committerName);

      PagedIterator<GHPullRequestCommitDetail> itr = Mockito.mock(PagedIterator.class);
      PagedIterable pagedItr = Mockito.mock(PagedIterable.class);

      Commit commit = mock(Commit.class);
      GHPullRequestCommitDetail commitDetail = mock(GHPullRequestCommitDetail.class);
     
     
      given(pr.listCommits()).willReturn(pagedItr);
     
      given(pagedItr.iterator()).willReturn(itr);
     
      given(itr.hasNext()).willReturn(true, false);
      given(itr.next()).willReturn(commitDetail);
     
      given(commitDetail.getCommit()).willReturn(commit);
      given(commit.getCommitter()).willReturn(committer);  
     
    given(cause.getCommentBody()).willReturn(comment);
  }
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.