Search in sources :

Example 1 with HgLogProvider

use of org.zmlx.hg4idea.log.HgLogProvider 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 HgLogProvider

use of org.zmlx.hg4idea.log.HgLogProvider 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 3 with HgLogProvider

use of org.zmlx.hg4idea.log.HgLogProvider 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)3 HgLogProvider (org.zmlx.hg4idea.log.HgLogProvider)3