Package org.eclipse.egit.core.synchronize.GitCommitsModelCache

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


    if (e1 instanceof GitModelTree && e2 instanceof GitModelCommit)
      return 1;

    if (e1 instanceof GitModelCommit && e2 instanceof GitModelCommit) {
      Commit rc1 = ((GitModelCommit) e1).getCachedCommitObj();
      Commit rc2 = ((GitModelCommit) e2).getCachedCommitObj();

      return rc2.getCommitDate().compareTo(rc1.getCommitDate());
    }

    return super.compare(viewer, e1, e2);
  }
View Full Code Here

    // given
    Viewer viewer = mock(Viewer.class);
    GitChangeSetSorter sorter = new GitChangeSetSorter();
    GitModelCommit commit1 = mock(GitModelCommit.class);
    GitModelCommit commit2 = mock(GitModelCommit.class);
    Commit mockCommit1 = mock(Commit.class);
    Commit mockCommit2 = mock(Commit.class);
    when(mockCommit1.getCommitDate()).thenReturn(new Date(333333L));
    when(mockCommit2.getCommitDate()).thenReturn(new Date(555555L));
    when(commit1.getCachedCommitObj()).thenReturn(mockCommit1);
    when(commit2.getCachedCommitObj()).thenReturn(mockCommit2);

    // when
    int actual1 = sorter.compare(viewer, commit1, commit2);
View Full Code Here

  protected Commit getCommit(File repoFile, String rev) throws Exception {
    Repository repo = lookupRepository(repoFile);
    ObjectId revId = repo.resolve(rev);

    Commit commit = mock(Commit.class);
    Mockito.when(commit.getId()).thenReturn(
        AbbreviatedObjectId.fromObjectId(revId));

    return commit;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.synchronize.GitCommitsModelCache.Commit

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.