本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNRevision.isValid方法的典型用法代码示例。如果您正苦于以下问题:Java SVNRevision.isValid方法的具体用法?Java SVNRevision.isValid怎么用?Java SVNRevision.isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.wc.SVNRevision
的用法示例。
在下文中一共展示了SVNRevision.isValid方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
public void apply(final SvnConfiguration configuration) throws ConfigurationException {
final UpdateRootInfo rootInfo = configuration.getUpdateRootInfo(myRoot.getIOFile(), myVcs);
if (myUpdateToSpecificUrl.isSelected()) {
try {
rootInfo.setUrl(SvnUtil.createUrl(myURLText.getText(), false));
}
catch (SvnBindException e) {
throw new ConfigurationException("Invalid url: " + myURLText.getText());
}
}
rootInfo.setUpdateToRevision(myRevisionBox.isSelected());
final SVNRevision revision = SVNRevision.parse(myRevisionText.getText());
if (!revision.isValid()) {
throw new ConfigurationException(SvnBundle.message("invalid.svn.revision.error.message", myRevisionText.getText()));
}
rootInfo.setRevision(revision);
}
示例2: format
import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@NotNull
public static String format(@NotNull String path, @Nullable SVNRevision pegRevision) {
StringBuilder builder = new StringBuilder(path);
boolean hasAtSymbol = path.contains("@");
boolean hasPegRevision = pegRevision != null &&
!SVNRevision.UNDEFINED.equals(pegRevision) &&
!SVNRevision.WORKING.equals(pegRevision) &&
pegRevision.isValid();
if (hasPegRevision || hasAtSymbol) {
// add '@' to correctly handle paths that contain '@' symbol
builder.append("@");
}
if (hasPegRevision) {
builder.append(format(pegRevision));
}
return builder.toString();
}
示例3: compareTo
import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
public int compareTo(VcsRevisionNumber vcsRevisionNumber) {
if (vcsRevisionNumber == null || vcsRevisionNumber.getClass() != SvnRevisionNumber.class) {
return -1;
}
SVNRevision rev = ((SvnRevisionNumber)vcsRevisionNumber).myRevision;
if (!myRevision.isValid()) {
return !rev.isValid() ? 0 : -1;
}
if (myRevision.getNumber() >= 0 && rev.getNumber() >= 0) {
return myRevision.getNumber() == rev.getNumber() ? 0 : myRevision.getNumber() > rev.getNumber() ? 1 : -1;
}
else if (myRevision.getDate() != null && rev.getDate() != null) {
return myRevision.getDate().compareTo(rev.getDate());
}
if (myRevision.equals(SVNRevision.HEAD)) {
return rev.equals(SVNRevision.HEAD) ? 0 : 1; // HEAD is greater than a specific rev
}
return myRevision.getID() == rev.getID() ? 0 : myRevision.getID() > rev.getID() ? 1 : -1;
}
示例4: getRevision
import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@NotNull
@Override
public SVNRevision getRevision() {
final SVNRevision revision = super.getRevision();
if (revision.isValid()) return revision;
final StatusType status = getContentsStatus();
if (StatusType.STATUS_NONE.equals(status) || StatusType.STATUS_UNVERSIONED.equals(status) ||
StatusType.STATUS_ADDED.equals(status)) return revision;
final Info info = initInfo();
return info == null ? revision : info.getRevision();
}
示例5: annotate
import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
public FileAnnotation annotate(final VirtualFile file) throws VcsException {
final SvnDiffProvider provider = (SvnDiffProvider)myVcs.getDiffProvider();
final SVNRevision currentRevision = ((SvnRevisionNumber)provider.getCurrentRevision(file)).getRevision();
final VcsRevisionDescription lastChangedRevision = provider.getCurrentRevisionDescription(file);
if (lastChangedRevision == null) {
throw new VcsException("Can not get current revision for file " + file.getPath());
}
final SVNRevision svnRevision = ((SvnRevisionNumber)lastChangedRevision.getRevisionNumber()).getRevision();
if (! svnRevision.isValid()) {
throw new VcsException("Can not get last changed revision for file: " + file.getPath() + "\nPlease run svn info for this file and file an issue.");
}
return annotate(file, new SvnFileRevision(myVcs, currentRevision, currentRevision, null, null, null, null, null),
lastChangedRevision.getRevisionNumber(), true);
}
示例6: getRevision
import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@NotNull
public SVNRevision getRevision() throws ConfigurationException {
if (myHead.isSelected()) return SVNRevision.HEAD;
final SVNRevision result = SVNRevision.parse(myRevisionField.getText());
if (!result.isValid()) {
throw new ConfigurationException(SvnBundle.message("invalid.svn.revision.error.message", myRevisionField.getText()));
}
return result;
}
示例7: isOKActionEnabled
import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
public boolean isOKActionEnabled() {
myErrorLabel.setText(" ");
if (myURL == null) {
return false;
}
if (myBranchOrTagRadioButton.isSelected() && myBranchTagBaseComboBox.getComboBox().getSelectedItem() == null) {
myErrorLabel.setText(SvnBundle.message("create.branch.no.base.location.error"));
return false;
}
String url = getToURL();
if (url != null && url.trim().length() > 0) {
if (myRepositoryRadioButton.isSelected()) {
SVNRevision revision;
try {
revision = myRevisionPanel.getRevision();
}
catch (ConfigurationException e) {
revision = SVNRevision.UNDEFINED;
}
if (!revision.isValid() || revision.isLocal()) {
myErrorLabel.setText(SvnBundle.message("create.branch.invalid.revision.error", myRevisionPanel.getRevisionText()));
return false;
}
return true;
}
else if (myWorkingCopyRadioButton.isSelected()) {
Info info = SvnVcs.getInstance(myProject).getInfo(mySrcFile);
String srcUrl = info != null && info.getURL() != null ? info.getURL().toString() : null;
if (srcUrl == null) {
myErrorLabel.setText(SvnBundle.message("create.branch.no.working.copy.error", myWorkingCopyField.getText()));
return false;
}
return true;
}
}
return false;
}
示例8: put
import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
public static void put(@NotNull List<String> parameters, @Nullable SVNRevision revision) {
if (revision != null && !SVNRevision.UNDEFINED.equals(revision) && !SVNRevision.WORKING.equals(revision) && revision.isValid()) {
parameters.add("--revision");
parameters.add(format(revision));
}
}