本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}
示例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>();
}
示例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;
}
示例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;
}
示例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());
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}