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


Java SVNRevision.getNumber方法代码示例

本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNRevision.getNumber方法的典型用法代码示例。如果您正苦于以下问题:Java SVNRevision.getNumber方法的具体用法?Java SVNRevision.getNumber怎么用?Java SVNRevision.getNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tmatesoft.svn.core.wc.SVNRevision的用法示例。


在下文中一共展示了SVNRevision.getNumber方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compareRevisions

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
private static int compareRevisions(@NotNull SVNRevision revision1, @NotNull SVNRevision revision2) {
  if (revision1.equals(revision2)) {
    return 0;
  }
  // working(local) ahead of head
  if (SVNRevision.WORKING.equals(revision1)) {
    return 1;
  }
  if (SVNRevision.WORKING.equals(revision2)) {
    return -1;
  }
  if (SVNRevision.HEAD.equals(revision1)) {
    return 1;
  }
  if (SVNRevision.HEAD.equals(revision2)) {
    return -1;
  }
  return revision1.getNumber() > revision2.getNumber() ? 1 : -1;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AbstractShowPropertiesDiffAction.java

示例2: resolveRevisionNumber

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
private SVNRevision resolveRevisionNumber(@NotNull File path, @Nullable SVNRevision revision) throws VcsException {
  long result = revision != null ? revision.getNumber() : -1;

  // base should be resolved manually - could not set revision to BASE to get revision property
  if (SVNRevision.BASE.equals(revision)) {
    Info info = myVcs.getInfo(path, SVNRevision.BASE);

    result = info != null ? info.getRevision().getNumber() : -1;
  }

  if (result == -1) {
    throw new VcsException("Could not determine revision number for file " + path + " and revision " + revision);
  }

  return SVNRevision.create(result);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CmdPropertyClient.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: createLogHandler

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@NotNull
private LogEntryConsumer createLogHandler(final SVNRevision fromIncluding,
                                             final SVNRevision toIncluding,
                                             final boolean includingYoungest,
                                             final boolean includeOldest, final List<CommittedChangeList> result) {
  return new LogEntryConsumer() {
    @Override
    public void consume(LogEntry logEntry) {
      if (myProject.isDisposed()) throw new ProcessCanceledException();
      final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
      if (progress != null) {
        progress.setText2(SvnBundle.message("progress.text2.processing.revision", logEntry.getRevision()));
        progress.checkCanceled();
      }
      if ((!includingYoungest) && (logEntry.getRevision() == fromIncluding.getNumber())) {
        return;
      }
      if ((!includeOldest) && (logEntry.getRevision() == toIncluding.getNumber())) {
        return;
      }
      result.add(new SvnChangeList(myVcs, myLocation, logEntry, myRepositoryRoot.toString()));
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SvnLogUtil.java

示例5: loadInterval

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@Override
public List<CommittedChangeList> loadInterval(final SVNRevision fromIncluding, final SVNRevision toIncluding, final int maxCount,
                                              final boolean includingYoungest, final boolean includeOldest)
  throws VcsException {
  long young = fromIncluding.getNumber();
  young = (young == -1) ? myRevisions.get(myRevisions.size() - 1) : young;
  final long old = toIncluding.getNumber();

  final List<CommittedChangeList> result = new ArrayList<CommittedChangeList>();

  int cnt = -1;
  // from back
  for (int i = myRevisions.size() - 1; i >= 0; -- i) {
    final Long current = myRevisions.get(i);
    if ((cnt == -1) && (current <= young)) {
      cnt = 0;
    }
    if (cnt >= 0) {
      ++ cnt;
    }
    if ((young > current) || (includingYoungest && (young == current))) {
      if ((old < current) || (includeOldest && (old == current))) {
        result.add(createList(current));
      }
    }
    if (cnt == maxCount) {
      break;
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:SvnCachingRevisionsTest.java


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