当前位置: 首页>>代码示例>>Java>>正文


Java SVNRevision.isValid方法代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SvnUpdateRootOptionsPanel.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:CommandUtil.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnRevisionNumber.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:PortableStatus.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SvnAnnotationProvider.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnRevisionPanel.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:CreateBranchOrTagDialog.java

示例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));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:CommandUtil.java


注:本文中的org.tmatesoft.svn.core.wc.SVNRevision.isValid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。