Search in sources :

Example 1 with VcsLogTextFilterImpl

use of com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl in project intellij-community by JetBrains.

the class HgTextFilterTest method testSubstringCaseSensitivity.

public void testSubstringCaseSensitivity() throws Exception {
    String smallBrackets = commit("[hg]");
    String bigBrackets = commit("[HG]");
    String smallNoBrackets = commit("letter h");
    String bigNoBrackets = commit("letter G");
    HgLogProvider provider = findLogProvider(myProject);
    String text = "[hg]";
    assertSameElements(Arrays.asList(bigBrackets, smallBrackets), getFilteredCommits(provider, new VcsLogTextFilterImpl(text, false, false)));
    assertSameElements(Collections.singletonList(smallBrackets), getFilteredCommits(provider, new VcsLogTextFilterImpl(text, false, true)));
    assertSameElements(Arrays.asList(bigNoBrackets, smallNoBrackets, bigBrackets, smallBrackets), getFilteredCommits(provider, new VcsLogTextFilterImpl(text, true, false)));
}
Also used : HgLogProvider(org.zmlx.hg4idea.log.HgLogProvider) VcsLogTextFilterImpl(com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl)

Example 2 with VcsLogTextFilterImpl

use of com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl in project intellij-community by JetBrains.

the class GitLogProviderTest method test_filter_by_text_and_user.

public void test_filter_by_text_and_user() throws Exception {
    List<String> hashes = generateHistoryForFilters(false, true);
    VcsUserImpl user = new VcsUserImpl(GitTestUtil.USER_NAME, GitTestUtil.USER_EMAIL);
    VcsLogUserFilter userFilter = new VcsLogUserFilterImpl(singleton(GitTestUtil.USER_NAME), Collections.emptyMap(), singleton(user));
    assertEquals(hashes, getFilteredHashes(new VcsLogFilterCollectionBuilder().with(userFilter).with(new VcsLogTextFilterImpl("", false, false)).build()));
    assertEquals(hashes, getFilteredHashes(new VcsLogFilterCollectionBuilder().with(userFilter).with(new VcsLogTextFilterImpl("", true, false)).build()));
}
Also used : VcsLogTextFilterImpl(com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl) VcsLogFilterCollectionBuilder(com.intellij.vcs.log.impl.VcsLogFilterCollectionImpl.VcsLogFilterCollectionBuilder)

Example 3 with VcsLogTextFilterImpl

use of com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl in project intellij-community by JetBrains.

the class HgTextFilterTest method _testRegexpCaseInsensitive.

public void _testRegexpCaseInsensitive() throws Exception {
    String numberedBigBug = commit("Bug 12345");
    String numberedSmallBug = commit("bug 12345");
    String smallBug = commit("just a bug");
    String bigBug = commit("not just a bug, but a BUG");
    commit("that\\047s nothing");
    HgLogProvider provider = findLogProvider(myProject);
    assertSameElements(Arrays.asList(numberedSmallBug, numberedBigBug), getFilteredCommits(provider, new VcsLogTextFilterImpl("Bug \\d+", true, false)));
    assertSameElements(Arrays.asList(numberedBigBug, numberedSmallBug, smallBug, bigBug), getFilteredCommits(provider, new VcsLogTextFilterImpl("BUG.*", true, false)));
}
Also used : HgLogProvider(org.zmlx.hg4idea.log.HgLogProvider) VcsLogTextFilterImpl(com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl)

Example 4 with VcsLogTextFilterImpl

use of com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl in project intellij-community by JetBrains.

the class HgTextFilterTest method testRegexp.

public void testRegexp() throws Exception {
    String numberedBigBug = commit("Bug 12345");
    commit("bug 12345");
    commit("just a bug");
    String bigBug = commit("not just a bug, but a BUG");
    commit("that\\047s nothing");
    HgLogProvider provider = findLogProvider(myProject);
    assertSameElements(Collections.singletonList(numberedBigBug), getFilteredCommits(provider, new VcsLogTextFilterImpl("Bug \\d+", true, true)));
    assertSameElements(Collections.singletonList(bigBug), getFilteredCommits(provider, new VcsLogTextFilterImpl("BUG.*", true, true)));
}
Also used : HgLogProvider(org.zmlx.hg4idea.log.HgLogProvider) VcsLogTextFilterImpl(com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl)

Aggregations

VcsLogTextFilterImpl (com.intellij.vcs.log.ui.filter.VcsLogTextFilterImpl)4 HgLogProvider (org.zmlx.hg4idea.log.HgLogProvider)3 VcsLogFilterCollectionBuilder (com.intellij.vcs.log.impl.VcsLogFilterCollectionImpl.VcsLogFilterCollectionBuilder)1