use of org.eclipse.team.core.history.IFileHistory in project egit by eclipse.
the class HistoryTest method testDeepHistory_A.
@Test
public void testDeepHistory_A() {
GitProvider provider = (GitProvider) RepositoryProvider.getProvider(project.project);
assertNotNull(provider);
IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.NONE, new NullProgressMonitor());
IFileRevision[] fileRevisions = fileHistory.getFileRevisions();
assertEquals(1, fileRevisions.length);
assertEquals("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359", fileRevisions[0].getContentIdentifier());
assertEquals("J. Author", fileRevisions[0].getAuthor());
}
use of org.eclipse.team.core.history.IFileHistory in project bndtools by bndtools.
the class ReleaseUtils method getTeamRevisions.
/**
* Returns the file revisions for the given resource. If the flags contains IFileHistoryProvider.SINGLE_REVISION
* then only the revision corresponding to the base corresponding to the local resource is fetched. If the flags
* contains IFileHistoryProvider.SINGLE_LINE_OF_DESCENT the resulting history will be restricted to a single
* line-of-descent (e.g. a single branch).
*
* @param resource
* @param flags
* @param monitor
* @return the file revisions for the given resource
*/
public static IFileRevision[] getTeamRevisions(IResource resource, int flags, IProgressMonitor monitor) {
RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
if (provider == null) {
return null;
}
IFileHistory history = provider.getFileHistoryProvider().getFileHistoryFor(resource, flags, monitor);
if (history == null) {
return new IFileRevision[0];
}
return history.getFileRevisions();
}
Aggregations