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


Java SVNRevision.create方法代码示例

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


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

示例1: getLastExistingRevision

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@NotNull
private SVNRevision getLastExistingRevision(@NotNull File file, @NotNull Status svnStatus) {
  WorkingCopyFormat format = myVcs.getWorkingCopyFormat(file);
  long revision = -1;

  // skipped for >= 1.8
  if (format.less(WorkingCopyFormat.ONE_DOT_EIGHT)) {
    // get really latest revision
    // TODO: Algorithm seems not to be correct in all cases - for instance, when some subtree was deleted and replaced by other
    // TODO: with same names. pegRevision should be used somehow but this complicates the algorithm
    if (svnStatus.getRepositoryRootURL() != null) {
      revision = new LatestExistentSearcher(myVcs, svnStatus.getURL(), svnStatus.getRepositoryRootURL()).getDeletionRevision();
    }
    else {
      LOG.info("Could not find repository url for file " + file);
    }
  }

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

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
public long getDeletionRevision() {
  if (! detectStartRevision()) return -1;

  final Ref<Long> latest = new Ref<Long>(myStartNumber);
  try {
    if (myEndNumber == -1) {
      myEndNumber = getLatestRevision();
    }

    final SVNURL existingParent = getExistingParent(myUrl);
    if (existingParent == null) {
      return myStartNumber;
    }

    final SVNRevision startRevision = SVNRevision.create(myStartNumber);
    SvnTarget target = SvnTarget.fromURL(existingParent, startRevision);
    myVcs.getFactory(target).createHistoryClient().doLog(target, startRevision, SVNRevision.HEAD, false, true, false, 0, null,
                                                         createHandler(latest));
  }
  catch (VcsException e) {
    LOG.info(e);
  }

  return latest.get().longValue();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:LatestExistentSearcher.java

示例4: existsInRevision

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
private boolean existsInRevision(@NotNull SVNURL url, long revisionNumber) throws SvnBindException {
  SVNRevision revision = SVNRevision.create(revisionNumber);
  Info info = null;

  try {
    info = myVcs.getInfo(url, revision, revision);
  }
  catch (SvnBindException e) {
    // throw error if not "does not exist" error code
    if (!e.contains(SVNErrorCode.RA_ILLEGAL_URL)) {
      throw e;
    }
  }

  return info != null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LatestExistentSearcher.java

示例5: doRemoteDetails

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
private void doRemoteDetails() throws SVNException, SvnBindException {
  for (Pair<Integer, Boolean> idxData : myWithoutDirStatus) {
    final Change sourceChange = myDetailedList.get(idxData.first.intValue());
    final SvnRepositoryContentRevision revision = (SvnRepositoryContentRevision)
        (idxData.second.booleanValue() ? sourceChange.getBeforeRevision() : sourceChange.getAfterRevision());
    if (revision == null) {
      continue;
    }
    // TODO: Logic with detecting "isDirectory" status is not clear enough. Why we can't just collect this info from logEntry and
    // TODO: if loading from disk - use cached values? Not to invoke separate call here.
    SVNRevision beforeRevision = SVNRevision.create(getRevision(idxData.second.booleanValue()));
    Info info = myVcs.getInfo(SvnUtil.createUrl(revision.getFullPath()), beforeRevision, beforeRevision);
    boolean isDirectory = info != null && info.isDirectory();
    Change replacingChange = new Change(createRevision((SvnRepositoryContentRevision)sourceChange.getBeforeRevision(), isDirectory),
                                        createRevision((SvnRepositoryContentRevision)sourceChange.getAfterRevision(), isDirectory));
    replacingChange.setIsReplaced(sourceChange.isIsReplaced());
    myDetailedList.set(idxData.first.intValue(), replacingChange);
  }

  myWithoutDirStatus.clear();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SvnChangeList.java

示例6: SvnFileRevision

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
public SvnFileRevision(SvnVcs vcs,
                       SVNRevision pegRevision,
                       LogEntry logEntry,
                       String url,
                       String copyFromPath) {
  final SVNRevision revision = SVNRevision.create(logEntry.getRevision());
  myRevisionNumber = new SvnRevisionNumber(revision);
  myPegRevision = pegRevision;
  myRevision = revision;
  myAuthor = logEntry.getAuthor();
  myDate = logEntry.getDate();
  myCommitMessage = logEntry.getMessage();
  myCopyFromPath = copyFromPath;
  myVCS = vcs;
  myURL = url;
  myMergeSources = new ArrayList<SvnFileRevision>();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:SvnFileRevision.java

示例7: createRevision

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@NotNull
private static SVNRevision createRevision(@Nullable Date date, @Nullable Long change, @NotNull SVNRevision defaultValue) {
  final SVNRevision result;

  if (date != null) {
    result = SVNRevision.create(date);
  }
  else if (change != null) {
    result = SVNRevision.create(change.longValue());
  }
  else {
    result = defaultValue;
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SvnCommittedChangesProvider.java

示例8: Info

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
public Info(String path,
            SVNURL url,
            @NotNull SVNRevision revision,
            @NotNull NodeKind kind,
            String uuid,
            SVNURL reposRootURL,
            long committedRevision,
            Date date,
            String author,
            @Nullable Lock lock,
            Depth depth) {
  super(kind);
  myIsRemote = true;
  myURL = url;
  myRevision = revision;
  myRepositoryRootURL = reposRootURL;
  myRepositoryUUID = uuid;

  myCommittedDate = date;
  myCommittedRevision = SVNRevision.create(committedRevision);
  myAuthor = author;

  myLock = lock;
  myPath = path;
  myDepth = depth;

  myFile = null;
  mySchedule = null;
  myCopyFromURL = null;
  myCopyFromRevision = null;
  myConflictOldFile = null;
  myConflictNewFile = null;
  myConflictWrkFile = null;
  myPropConflictFile = null;
  myTreeConflict = null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:Info.java

示例9: load

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@Override
public void load() throws SVNException, VcsException {
  SVNRevision from = SVNRevision.create(myVersion.getPegRevision());
  myProvider.reportAppendableHistory(myPath, mySessionAdapter, from, myPeg, myPeg == null ? LIMIT : 0, myPeg, true);
  VcsAbstractHistorySession session = mySessionAdapter.getSession();
  if (myListToReportLoaded != null && session != null) {
    List<VcsFileRevision> list = session.getRevisionList();
    for (VcsFileRevision revision : list) {
      myListToReportLoaded.add(((SvnRevisionNumber) revision.getRevisionNumber()).getRevision().getNumber());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TreeConflictRefreshablePanel.java

示例10: setRevisionForWaitingFiles

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
private void setRevisionForWaitingFiles(long revisionNumber) {
  SvnRevisionNumber revision = new SvnRevisionNumber(SVNRevision.create(revisionNumber));

  for (Pair<String, String> pair : myFilesWaitingForRevision.pop()) {
    FileGroup fileGroup = myUpdatedFiles.getGroupById(pair.getFirst());

    fileGroup.add(pair.getSecond(), SvnVcs.getKey(), revision);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:UpdateEventHandler.java

示例11: getBeforeRevisionValue

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
protected SVNRevision getBeforeRevisionValue(final Change change, final SvnVcs vcs) throws SVNException {
  final ContentRevision beforeRevision = change.getBeforeRevision();
  if (beforeRevision != null) {
    return ((SvnRevisionNumber) beforeRevision.getRevisionNumber()).getRevision();
  } else {
    return SVNRevision.create(((SvnRevisionNumber) change.getAfterRevision().getRevisionNumber()).getRevision().getNumber() - 1);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ShowPropertiesDiffAction.java

示例12: getAfterRevisionValue

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
protected SVNRevision getAfterRevisionValue(final Change change, final SvnVcs vcs) throws SVNException {
  final ContentRevision afterRevision = change.getAfterRevision();
  if (afterRevision != null) {
    // CurrentContentRevision will be here, for instance, if invoked from changes dialog for "Compare with Branch" action
    return afterRevision instanceof CurrentContentRevision
           ? SVNRevision.WORKING
           : ((SvnRevisionNumber)afterRevision.getRevisionNumber()).getRevision();
  } else {
    return SVNRevision.create(((SvnRevisionNumber) change.getBeforeRevision().getRevisionNumber()).getRevision().getNumber() + 1);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ShowPropertiesDiffAction.java

示例13: revisionRange

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
@NotNull
public SVNRevisionRange revisionRange() {
  SVNRevision startRevision = SVNRevision.create(lowestNumber() - 1);
  SVNRevision endRevision = SVNRevision.create(highestNumber());

  return myInvertRange ? new SVNRevisionRange(endRevision, startRevision) : new SVNRevisionRange(startRevision, endRevision);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:Merger.java

示例14: createRevision

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
protected SvnFileRevision createRevision(final LogEntry logEntry, final String copyPath, LogEntryPath entryPath) throws SVNException {
      Date date = logEntry.getDate();
      String author = logEntry.getAuthor();
      String message = logEntry.getMessage();
      SVNRevision rev = SVNRevision.create(logEntry.getRevision());
      final SVNURL url = myRepositoryRoot.appendPath(myLastPath, true);
//      final SVNURL url = entryPath != null ? myRepositoryRoot.appendPath(entryPath.getPath(), true) :
//                         myRepositoryRoot.appendPath(myLastPathCorrector.getBefore(), false);
      return new SvnFileRevision(myVcs, myPegRevision, rev, url.toString(), author, date, message, copyPath);
    }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:SvnHistoryProvider.java

示例15: processDescription

import org.tmatesoft.svn.core.wc.SVNRevision; //导入方法依赖的package包/类
private BeforeAfter<ConflictSidePresentation> processDescription(TreeConflictDescription description) throws VcsException {
  if (description == null) return null;
  if (myChange.getBeforeRevision() != null) {
    myCommittedRevision = (SvnRevisionNumber)SvnHistorySession.getCurrentCommittedRevision(myVcs,
            myChange.getBeforeRevision() != null ? myChange.getBeforeRevision().getFile().getIOFile() : myPath.getIOFile());
  }
  boolean differentURLs = isDifferentURLs(description);

  ConflictSidePresentation leftSide = null;
  ConflictSidePresentation rightSide = null;
  try {
    if (differentURLs) {
      leftSide = createSide(description.getSourceLeftVersion(), null, true);
      rightSide = createSide(description.getSourceRightVersion(), null, false);
      leftSide.load();
      rightSide.load();
    } else {
      //only one side
      leftSide = EmptyConflictSide.getInstance();
      final SVNRevision pegFromLeft;
      if (description.getSourceLeftVersion() == null) {
        pegFromLeft = null;
      }
      else {
        long committed = description.getSourceLeftVersion().getPegRevision();
        if (myCommittedRevision != null && myCommittedRevision.getRevision().getNumber() < committed &&
          myCommittedRevision.getRevision().isValid()) {
          committed = myCommittedRevision.getRevision().getNumber();
        }
        pegFromLeft = SVNRevision.create(committed);
      }
      rightSide = createSide(description.getSourceRightVersion(), pegFromLeft, false);
      rightSide.load();
      return new BeforeAfter<ConflictSidePresentation>(leftSide, rightSide);
    }
  } catch (SVNException e) {
    throw new VcsException(e);
  } finally {
    if (leftSide != null) {
      myChildDisposables.add(leftSide);
    }
    if (rightSide != null) {
      myChildDisposables.add(rightSide);
    }
  }

  return new BeforeAfter<ConflictSidePresentation>(leftSide, rightSide);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:TreeConflictRefreshablePanel.java


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