use of org.zmlx.hg4idea.util.HgPatchReferenceValidator in project intellij-community by JetBrains.
the class HgQRenameCommand method execute.
public void execute(@NotNull final Hash patchHash) {
final Project project = myRepository.getProject();
HgNameWithHashInfo patchInfo = ContainerUtil.find(myRepository.getMQAppliedPatches(), new Condition<HgNameWithHashInfo>() {
@Override
public boolean value(HgNameWithHashInfo info) {
return info.getHash().equals(patchHash);
}
});
if (patchInfo == null) {
LOG.error("Could not find patch " + patchHash.toString());
return;
}
final String oldName = patchInfo.getName();
final String newName = Messages.showInputDialog(project, String.format("Enter a new name for %s patch:", oldName), "Rename Patch", Messages.getQuestionIcon(), "", new HgPatchReferenceValidator(myRepository));
if (newName != null) {
performPatchRename(myRepository, oldName, newName);
}
}
Aggregations