Package org.eclipse.jgit.revwalk

Examples of org.eclipse.jgit.revwalk.RevCommit.abbreviate()


        String oursName = String.format("HEAD   (%s %s)",
            ours.abbreviate(6).name(),
            oursMsg.substring(0, Math.min(oursMsg.length(), 60)));
        String theirsName = String.format("BRANCH (%s %s)",
            theirs.abbreviate(6).name(),
            theirsMsg.substring(0, Math.min(theirsMsg.length(), 60)));

        MergeFormatter fmt = new MergeFormatter();
        Map<String, MergeResult<? extends Sequence>> r = m.getMergeResults();
        Map<String, ObjectId> resolved = new HashMap<String, ObjectId>();
View Full Code Here


        // Commit index changes
        CommitBuilder builder = createBuilder();
        builder.setParentId(headCommit);
        builder.setTreeId(cache.writeTree(inserter));
        builder.setMessage(MessageFormat.format(indexMessage, branch,
            headCommit.abbreviate(7).name(),
            headCommit.getShortMessage()));
        ObjectId indexCommit = inserter.insert(builder);

        // Commit untracked changes
        ObjectId untrackedCommit = null;
View Full Code Here

          untrackedBuilder.finish();

          builder.setParentIds(new ObjectId[0]);
          builder.setTreeId(untrackedDirCache.writeTree(inserter));
          builder.setMessage(MessageFormat.format(MSG_UNTRACKED,
              branch, headCommit.abbreviate(7).name(),
              headCommit.getShortMessage()));
          untrackedCommit = inserter.insert(builder);
        }

        // Commit working tree changes
View Full Code Here

        builder.addParentId(indexCommit);
        if (untrackedCommit != null)
          builder.addParentId(untrackedCommit);
        builder.setMessage(MessageFormat.format(
            workingDirectoryMessage, branch,
            headCommit.abbreviate(7).name(),
            headCommit.getShortMessage()));
        builder.setTreeId(cache.writeTree(inserter));
        commitId = inserter.insert(builder);
        inserter.flush();
View Full Code Here

    }

    @Test
    public void testGetAbbreviatedCommitId() throws Exception {
        RevCommit rawCommit = this.createCommit();
        AbbreviatedObjectId abbrevId = rawCommit.abbreviate(7);
        JGitCommit commit = new JGitCommit(rawCommit);

        when(this.repo.getObjectDatabase().newReader().abbreviate(rawCommit)).thenReturn(abbrevId);

        assertThat(this.repository.getAbbreviatedCommitId(commit), is(equalTo(rawCommit.getName().substring(0, 7))));
View Full Code Here

        // Commit index changes
        CommitBuilder builder = createBuilder(headCommit);
        builder.setTreeId(cache.writeTree(inserter));
        builder.setMessage(MessageFormat.format(indexMessage, branch,
            headCommit.abbreviate(7).name(),
            headCommit.getShortMessage()));
        ObjectId indexCommit = inserter.insert(builder);

        // Commit working tree changes
        if (!wtEdits.isEmpty() || !wtDeletes.isEmpty()) {
View Full Code Here

          editor.finish();
        }
        builder.addParentId(indexCommit);
        builder.setMessage(MessageFormat.format(
            workingDirectoryMessage, branch,
            headCommit.abbreviate(7).name(),
            headCommit.getShortMessage()));
        builder.setTreeId(cache.writeTree(inserter));
        commitId = inserter.insert(builder);
        inserter.flush();
View Full Code Here

          op.execute(monitor);
        } catch (CoreException e) {
          return new Status(IStatus.ERROR, Activator.getPluginId(),
              MessageFormat.format(
                  UIText.StashApplyCommand_applyFailed,
                  commit.abbreviate(7).name(),
                  e.getLocalizedMessage()), e);
        }
        return Status.OK_STATUS;
      }
View Full Code Here

          .getLineOfLastMouseButtonActivity();

    RevCommit commit = this.revision.getCommit();

    String linkText = MessageFormat.format(
        UIText.BlameInformationControl_Commit, commit.abbreviate(7)
            .name());
    commitLabel.setText(linkText);

    PersonIdent author = commit.getAuthorIdent();
    if (author != null) {
View Full Code Here

      toolkit.createLabel(parents, getParentCommitLabel(i))
          .setForeground(
              toolkit.getColors().getColor(IFormColors.TB_TOGGLE));
      final Hyperlink link = toolkit
          .createHyperlink(parents,
              parentCommit.abbreviate(PARENT_LENGTH).name(),
              SWT.NONE);
      link.addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent e) {
          try {
            CommitEditor.open(new RepositoryCommit(getCommit()
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.