Search in sources :

Example 1 with VcsAppendableHistoryPartnerAdapter

use of com.intellij.openapi.vcs.history.VcsAppendableHistoryPartnerAdapter in project intellij-community by JetBrains.

the class SvnProtocolsTest method testHistoryImpl.

private void testHistoryImpl(String s) throws VcsException {
    final VcsHistoryProvider provider = myVcs.getVcsHistoryProvider();
    final VcsAppendableHistoryPartnerAdapter partner = new VcsAppendableHistoryPartnerAdapter() {

        @Override
        public void acceptRevision(VcsFileRevision revision) {
            super.acceptRevision(revision);
            if (getSession().getRevisionList().size() > 1) {
                throw new ProcessCanceledException();
            }
        }
    };
    try {
        provider.reportAppendableHistory(VcsContextFactory.SERVICE.getInstance().createFilePathOnNonLocal(s, true), partner);
    } catch (ProcessCanceledException e) {
    //ok
    }
    final List<VcsFileRevision> list = partner.getSession().getRevisionList();
    Assert.assertTrue(!list.isEmpty());
}
Also used : VcsHistoryProvider(com.intellij.openapi.vcs.history.VcsHistoryProvider) VcsAppendableHistoryPartnerAdapter(com.intellij.openapi.vcs.history.VcsAppendableHistoryPartnerAdapter) VcsFileRevision(com.intellij.openapi.vcs.history.VcsFileRevision) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException)

Aggregations

ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 VcsAppendableHistoryPartnerAdapter (com.intellij.openapi.vcs.history.VcsAppendableHistoryPartnerAdapter)1 VcsFileRevision (com.intellij.openapi.vcs.history.VcsFileRevision)1 VcsHistoryProvider (com.intellij.openapi.vcs.history.VcsHistoryProvider)1