本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNRevision类的典型用法代码示例。如果您正苦于以下问题:Java SVNRevision类的具体用法?Java SVNRevision怎么用?Java SVNRevision使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SVNRevision类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNRevision类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copy
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
@Override
public void copy(@NotNull SvnTarget source,
@NotNull File destination,
@Nullable SVNRevision revision,
boolean makeParents,
@Nullable ProgressTracker handler) throws VcsException {
SVNCopyClient client = myVcs.getSvnKitManager().createCopyClient();
client.setEventHandler(toEventHandler(handler));
try {
client.doCopy(new SVNCopySource[]{createCopySource(source, revision)}, destination, false, makeParents, true);
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
示例2: checkout
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
private static void checkout(final SVNUpdateClient updateClient, final String checkoutRootPath, final String destRootPath, final String repoPath, final SVNDepth depth) {
// updateClient.doExport(
// SVNURL.parseURIDecoded(checkoutRootPath + "/" + repoPath),
// new File(destRootPath + (!repoPath.isEmpty() ? "/" : "") + repoPath),
// SVNRevision.UNDEFINED,
// SVNRevision.HEAD,
// null,
// true,
// depth);
try {
updateClient.doCheckout(
SVNURL.parseURIDecoded(checkoutRootPath + "/" + repoPath),
new File(destRootPath + (!repoPath.isEmpty() ? "/" : "") + repoPath),
SVNRevision.UNDEFINED,
SVNRevision.HEAD,
depth,
true);
} catch (final SVNException e) {
System.err.println("Exception sur le fichier " + checkoutRootPath + "/" + repoPath);
System.err.println(e.getMessage());
}
}
示例3: diff
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
/********************************
* 작성일 : 2016. 5. 5. 작성자 : KYJ
*
*
* @param path1
* @param rivision1
* @param path2
* @param rivision2
* @return
* @throws SVNException
* @throws UnsupportedEncodingException
********************************/
public String diff(String path1, SVNRevision rivision1, String path2, SVNRevision rivision2) throws SVNException, Exception {
SVNDiffClient diffClient = getSvnManager().getDiffClient();
// StringOutputStream result = new StringOutputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream();
// SVNURL svnURL = getSvnURL();
// String repositoryPath = getRepository().getRepositoryPath(path1);
SVNURL location = getRepository().getLocation();
String decodedString = location.toDecodedString();
String uriEncodedPath = location.getURIEncodedPath();
String rootUrl = decodedString.replaceAll(uriEncodedPath, "");
SVNURL svnUrl1 = SVNURL.parseURIEncoded(rootUrl + "/" + path1/*getRepository().getRepositoryPath(path1)*/);
SVNURL svnUrl2 = SVNURL.parseURIEncoded(rootUrl + "/" + path2/*getRepository().getRepositoryPath(path2)*/);
diffClient.doDiff(svnUrl1, rivision1, svnUrl2, rivision2, SVNDepth.UNKNOWN, true, out);
return out.toString("UTF-8");
}
示例4: createRevision
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
@NotNull
private ContentRevision createRevision(@NotNull FilePath path,
@NotNull FilePath localPath,
@NotNull SVNRevision revision,
@NotNull FileStatus status) {
ContentRevision result;
if (path.isNonLocal()) {
// explicitly use local path for deleted items - so these items will be correctly displayed as deleted under local working copy node
// and not as deleted under remote branch node (in ChangesBrowser)
// NOTE, that content is still retrieved using remotePath.
result = SvnRepositoryContentRevision.create(myVcs, path, status == FileStatus.DELETED ? localPath : null, revision.getNumber());
}
else {
result = CurrentContentRevision.create(path);
}
return result;
}
示例5: doCopy
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
private void doCopy(final SVNURL src, final SVNURL dst, final boolean move, final String comment) {
final Ref<Exception> exception = new Ref<Exception>();
Runnable command = new Runnable() {
public void run() {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText((move ? SvnBundle.message("progress.text.browser.moving", src) : SvnBundle.message("progress.text.browser.copying", src)));
progress.setText2(SvnBundle.message("progress.text.browser.remote.destination", dst));
}
SvnVcs vcs = SvnVcs.getInstance(myProject);
try {
vcs.getFactoryFromSettings().createCopyMoveClient().copy(SvnTarget.fromURL(src), SvnTarget.fromURL(dst), SVNRevision.HEAD, true,
move, comment, null);
}
catch (VcsException e) {
exception.set(e);
}
}
};
String progressTitle = move ? SvnBundle.message("progress.title.browser.move") : SvnBundle.message("progress.title.browser.copy");
ProgressManager.getInstance().runProcessWithProgressSynchronously(command, progressTitle, false, myProject);
if (!exception.isNull()) {
Messages.showErrorDialog(exception.get().getMessage(), SvnBundle.message("message.text.error"));
}
}
示例6: checkout
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
@Override
public void checkout(@NotNull SvnTarget source,
@NotNull File destination,
@Nullable SVNRevision revision,
@Nullable Depth depth,
boolean ignoreExternals,
boolean force,
@NotNull WorkingCopyFormat format,
@Nullable ProgressTracker handler) throws VcsException {
validateFormat(format, getSupportedFormats());
List<String> parameters = new ArrayList<String>();
CommandUtil.put(parameters, source);
CommandUtil.put(parameters, destination, false);
CommandUtil.put(parameters, depth);
CommandUtil.put(parameters, revision);
CommandUtil.put(parameters, ignoreExternals, "--ignore-externals");
CommandUtil.put(parameters, force, "--force"); // corresponds to "allowUnversionedObstructions" in SVNKit
run(source, destination, handler, parameters);
}
示例7: collectResolvablePaths
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
private static Collection<String> collectResolvablePaths(final SvnVcs vcs, VirtualFile[] files) {
final Collection<String> target = new TreeSet<String>();
for (VirtualFile file : files) {
try {
File path = new File(file.getPath());
StatusClient client = vcs.getFactory(path).createStatusClient();
client.doStatus(path, SVNRevision.UNDEFINED, Depth.INFINITY, false, false, false, false, new StatusConsumer() {
@Override
public void consume(Status status) {
if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED ||
status.getPropertiesStatus() == StatusType.STATUS_CONFLICTED) {
target.add(status.getFile().getAbsolutePath());
}
}
}, null);
}
catch (SvnBindException e) {
LOG.warn(e);
}
}
return target;
}
示例8: isBinary
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
public boolean isBinary(@NotNull final VirtualFile file) {
SvnVcs vcs = SvnVcs.getInstance(myProject);
try {
File ioFile = new File(file.getPath());
PropertyClient client = vcs.getFactory(ioFile).createPropertyClient();
PropertyValue value = client.getProperty(SvnTarget.fromFile(ioFile), SvnPropertyKeys.SVN_MIME_TYPE, false, SVNRevision.WORKING);
if (value != null && isBinaryMimeType(value.toString())) {
return true;
}
}
catch (VcsException e) {
LOG.warn(e);
}
return false;
}
示例9: mergeInfoChanged
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
private boolean mergeInfoChanged(final File file) {
SvnTarget target = SvnTarget.fromFile(file);
try {
PropertyValue current =
myVcs.getFactory(target).createPropertyClient().getProperty(target, SvnPropertyKeys.MERGE_INFO, false, SVNRevision.WORKING);
PropertyValue base =
myVcs.getFactory(target).createPropertyClient().getProperty(target, SvnPropertyKeys.MERGE_INFO, false, SVNRevision.BASE);
if (current != null) {
return base == null || !Comparing.equal(current, base);
}
}
catch (VcsException e) {
LOG.info(e);
}
return false;
}
示例10: 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>();
}
示例11: 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();
}
示例12: prepareCommand
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
private static List<String> prepareCommand(@NotNull SvnTarget target,
@NotNull SVNRevision startRevision,
@NotNull SVNRevision endRevision,
boolean stopOnCopy, boolean discoverChangedPaths, boolean includeMergedRevisions, long limit) {
List<String> parameters = new ArrayList<String>();
CommandUtil.put(parameters, target);
CommandUtil.put(parameters, startRevision, endRevision);
CommandUtil.put(parameters, stopOnCopy, "--stop-on-copy");
CommandUtil.put(parameters, discoverChangedPaths, "--verbose");
CommandUtil.put(parameters, includeMergedRevisions, "--use-merge-history");
if (limit > 0) {
parameters.add("--limit");
parameters.add(String.valueOf(limit));
}
parameters.add("--xml");
return parameters;
}
示例13: updateToTheirsFull
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
private void updateToTheirsFull() throws VcsException {
final File ioFile = myPath.getIOFile();
Status status = myVcs.getFactory(ioFile).createStatusClient().doStatus(ioFile, false);
if (status == null || StatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus())) {
revert(ioFile);
updateFile(ioFile, SVNRevision.HEAD);
} else if (StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
revert(ioFile);
updateFile(ioFile, SVNRevision.HEAD);
FileUtil.delete(ioFile);
} else {
Set<File> usedToBeAdded = myPath.isDirectory() ? getDescendantsWithAddedStatus(ioFile) : ContainerUtil.<File>newHashSet();
revert(ioFile);
for (File wasAdded : usedToBeAdded) {
FileUtil.delete(wasAdded);
}
updateFile(ioFile, SVNRevision.HEAD);
}
}
示例14: getDescendantsWithAddedStatus
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
@NotNull
private Set<File> getDescendantsWithAddedStatus(@NotNull File ioFile) throws SvnBindException {
final Set<File> result = ContainerUtil.newHashSet();
StatusClient statusClient = myVcs.getFactory(ioFile).createStatusClient();
statusClient.doStatus(ioFile, SVNRevision.UNDEFINED, Depth.INFINITY, false, false, false, false,
new StatusConsumer() {
@Override
public void consume(Status status) throws SVNException {
if (status != null && StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
result.add(status.getFile());
}
}
}, null);
return result;
}
示例15: doLog
import org.tmatesoft.svn.core.wc.SVNRevision; //导入依赖的package包/类
@Override
public void doLog(@NotNull SvnTarget target,
@NotNull SVNRevision startRevision,
@NotNull SVNRevision endRevision,
boolean stopOnCopy,
boolean discoverChangedPaths,
boolean includeMergedRevisions,
long limit,
@Nullable String[] revisionProperties,
@Nullable LogEntryConsumer handler) throws VcsException {
// TODO: add revision properties parameter if necessary
List<String> parameters =
prepareCommand(target, startRevision, endRevision, stopOnCopy, discoverChangedPaths, includeMergedRevisions, limit);
try {
CommandExecutor command = execute(myVcs, target, SvnCommandName.log, parameters, null);
// TODO: handler should be called in parallel with command execution, but this will be in other thread
// TODO: check if that is ok for current handler implementation
parseOutput(command, handler);
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}