Search in sources :

Example 1 with HgBranchReferenceValidator

use of org.zmlx.hg4idea.util.HgBranchReferenceValidator in project intellij-community by JetBrains.

the class HgReferenceValidatorTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    HgRepository hgRepository = HgRepositoryImpl.getInstance(myRepository, myProject, myProject);
    assertNotNull(hgRepository);
    myValidator = new HgBranchReferenceValidator(hgRepository);
    cd(myRepository);
    hg("branch '" + BRANCH_NAME + "'");
    String firstFile = "file.txt";
    echo(firstFile, BRANCH_NAME);
    hg("commit -m 'createdBranch " + BRANCH_NAME + "' ");
    hg("branch '" + UNCOMMITTED_BRANCH + "'");
    hgRepository.update();
}
Also used : HgBranchReferenceValidator(org.zmlx.hg4idea.util.HgBranchReferenceValidator) HgRepository(org.zmlx.hg4idea.repo.HgRepository) Before(org.junit.Before)

Example 2 with HgBranchReferenceValidator

use of org.zmlx.hg4idea.util.HgBranchReferenceValidator in project intellij-community by JetBrains.

the class HgTagDialog method validateFields.

private void validateFields() {
    HgReferenceValidator validator = new HgBranchReferenceValidator(hgRepositorySelectorComponent.getRepository());
    String name = getTagName();
    if (!validator.checkInput(name)) {
        String message = validator.getErrorText(name);
        setErrorText(message == null ? "You have to specify tag name." : message, tagTxt);
        setOKActionEnabled(false);
        return;
    }
    setErrorText(null);
    setOKActionEnabled(true);
}
Also used : HgBranchReferenceValidator(org.zmlx.hg4idea.util.HgBranchReferenceValidator) HgReferenceValidator(org.zmlx.hg4idea.util.HgReferenceValidator)

Example 3 with HgBranchReferenceValidator

use of org.zmlx.hg4idea.util.HgBranchReferenceValidator in project intellij-community by JetBrains.

the class HgBookmarkDialog method validateFields.

private void validateFields() {
    HgReferenceValidator validator = new HgBranchReferenceValidator(myRepository);
    String name = getName();
    if (!validator.checkInput(name)) {
        String message = validator.getErrorText(name);
        setErrorText(message == null ? "You have to specify bookmark name." : message, myBookmarkName);
        setOKActionEnabled(false);
        return;
    }
    setErrorText(null);
    setOKActionEnabled(true);
}
Also used : HgBranchReferenceValidator(org.zmlx.hg4idea.util.HgBranchReferenceValidator) HgReferenceValidator(org.zmlx.hg4idea.util.HgReferenceValidator)

Aggregations

HgBranchReferenceValidator (org.zmlx.hg4idea.util.HgBranchReferenceValidator)3 HgReferenceValidator (org.zmlx.hg4idea.util.HgReferenceValidator)2 Before (org.junit.Before)1 HgRepository (org.zmlx.hg4idea.repo.HgRepository)1