本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNInfo类的典型用法代码示例。如果您正苦于以下问题:Java SVNInfo类的具体用法?Java SVNInfo怎么用?Java SVNInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVNInfo类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
@NotNull
public static Info create(@NotNull SVNInfo info) {
Info result;
if (info.isRemote()) {
result = new Info(info.getPath(), info.getURL(), info.getRevision(), NodeKind.from(info.getKind()), info.getRepositoryUUID(),
info.getRepositoryRootURL(), info.getCommittedRevision().getNumber(), info.getCommittedDate(), info.getAuthor(),
Lock.create(info.getLock()), Depth.from(info.getDepth()));
}
else {
result =
new Info(info.getFile(), info.getURL(), info.getRepositoryRootURL(), info.getRevision().getNumber(), NodeKind.from(info.getKind()),
info.getRepositoryUUID(), info.getCommittedRevision().getNumber(), toString(info.getCommittedDate()), info.getAuthor(),
info.getSchedule(), info.getCopyFromURL(), info.getCopyFromRevision().getNumber(), getName(info.getConflictOldFile()),
getName(info.getConflictNewFile()), getName(info.getConflictWrkFile()), getName(info.getPropConflictFile()),
Lock.create(info.getLock()), Depth.from(info.getDepth()), TreeConflictDescription.create(info.getTreeConflict()));
}
return result;
}
示例2: getInfo
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
/**
* Returns an ArrayLIst with Info for all files found in file.
*
* @param file
* @return
*/
public java.util.List<SVNInfo> getInfo(final File file) {
final java.util.List<SVNInfo> ret = new ArrayList<SVNInfo>();
try {
getWCClient().doInfo(file, SVNRevision.UNDEFINED, SVNRevision.WORKING, SVNDepth.getInfinityOrEmptyDepth(true), null, new ISVNInfoHandler() {
@Override
public void handleInfo(final SVNInfo info) {
ret.add(info);
}
});
} catch (final SVNException e) {
e.printStackTrace();
}
return ret;
}
示例3: getRevision
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
public long getRevision(final File resource) throws SVNException {
final long[] ret = new long[] { -1 };
getWCClient().doInfo(resource, SVNRevision.UNDEFINED, SVNRevision.WORKING, SVNDepth.EMPTY, null, new ISVNInfoHandler() {
@Override
public void handleInfo(final SVNInfo info) {
final long rev = info.getCommittedRevision().getNumber();
if (rev > ret[0]) {
ret[0] = rev;
}
}
});
return ret[0];
}
示例4: checkAncestry
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
private boolean checkAncestry(final File sourceFile, final SVNURL targetUrl, final SVNRevision targetRevision) throws SVNException {
final SVNWCClient client = myVcs.createWCClient();
final SVNInfo sourceSvnInfo = client.doInfo(sourceFile, SVNRevision.UNDEFINED);
final SVNInfo targetSvnInfo = client.doInfo(targetUrl, SVNRevision.UNDEFINED, targetRevision);
if (sourceSvnInfo == null || targetSvnInfo == null) {
// cannot check
return true;
}
final SVNURL copyFromTarget = targetSvnInfo.getCopyFromURL();
final SVNURL copyFromSource = sourceSvnInfo.getCopyFromURL();
if ((copyFromSource != null) || (copyFromTarget != null)) {
if (sourceSvnInfo.getURL().equals(copyFromTarget) || targetUrl.equals(copyFromSource)) {
return true;
}
}
final int result = Messages.showYesNoDialog(myVcs.getProject(), SvnBundle.message("switch.target.not.copy.current"),
SvnBundle.message("switch.target.problem.title"), Messages.getWarningIcon());
return (DialogWrapper.OK_EXIT_CODE == result);
}
示例5: UpdateRootInfo
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
public UpdateRootInfo(File file, SvnVcs vcs) {
myRevision = SVNRevision.HEAD;
try {
SVNWCClient wcClient = vcs.createWCClient();
SVNInfo info = wcClient.doInfo(file, SVNRevision.UNDEFINED);
if (info != null) {
final SVNURL url = info.getURL();
myUrl = url.toString();
} else {
myUrl = "";
}
}
catch (SVNException e) {
myUrl = "";
}
}
示例6: checkAlive
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
private SvnMergeInfoCache.MergeCheckResult checkAlive(final SvnChangeList list, final String branchPath) {
final SVNInfo info = getInfo(new File(branchPath));
if (info == null || info.getURL() == null || (! SVNPathUtil.isAncestor(myBranchUrl, info.getURL().toString()))) {
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
final String subPathUnderBranch = SVNPathUtil.getRelativePath(myBranchUrl, info.getURL().toString());
final MultiMap<SvnMergeInfoCache.MergeCheckResult, String> result = new MultiMap<SvnMergeInfoCache.MergeCheckResult, String>();
checkPaths(list.getNumber(), list.getAddedPaths(), branchPath, subPathUnderBranch, result);
if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS)) {
return SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
}
checkPaths(list.getNumber(), list.getDeletedPaths(), branchPath, subPathUnderBranch, result);
if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS)) {
return SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
}
checkPaths(list.getNumber(), list.getChangedPaths(), branchPath, subPathUnderBranch, result);
if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS)) {
return SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
} else if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_MERGED)) {
myPartlyMerged.put(list.getNumber(), result.get(SvnMergeInfoCache.MergeCheckResult.NOT_MERGED));
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
return SvnMergeInfoCache.MergeCheckResult.MERGED;
}
示例7: convert
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
public static SVNStatus convert(final String path, Status status, final Convertor<String, SVNInfo> infoGetter) throws SVNException {
// no locks
return new PortableStatus(createUrl(status.getUrl()), new File(path), NodeKindConvertor.convert(status.getNodeKind()),
RevisionConvertor.convert(status.getRevision()), RevisionConvertor.convert(status.getLastChangedRevision()),
status.getLastChangedDate(), status.getLastCommitAuthor(), convert(status.getTextStatus()),
convert(status.getPropStatus()), convert(status.getRepositoryTextStatus()),
convert(status.getRepositoryPropStatus()), status.isLocked(), status.isCopied(), status.isSwitched(),
status.isFileExternal(), null, null, null, status.getChangelist(), WorkingCopyFormat.ONE_DOT_SEVEN.getFormat(),
status.isConflicted(),
new Getter<SVNInfo>() {
@Override
public SVNInfo get() {
return infoGetter.convert(path);
}
});
}
示例8: realTargetUrl
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
@Nullable
private static SVNURL realTargetUrl(final SvnVcs vcs, final WorkingCopyInfo info, final String targetBranchUrl) {
final SVNWCClient client = vcs.createWCClient();
try {
final SVNInfo svnInfo = client.doInfo(new File(info.getLocalPath()), SVNRevision.UNDEFINED);
final SVNURL svnurl = svnInfo.getURL();
if ((svnurl != null) && (svnurl.toString().startsWith(targetBranchUrl))) {
return svnurl;
}
}
catch (SVNException e) {
// tracked by return value
}
return null;
}
示例9: detectStartRevision
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
private boolean detectStartRevision() {
if (! myStartExistsKnown) {
final SvnFileUrlMapping mapping = myVcs.getSvnFileUrlMapping();
final RootUrlInfo rootUrlInfo = mapping.getWcRootForUrl(myUrl.toString());
if (rootUrlInfo == null) return true;
final VirtualFile vf = rootUrlInfo.getVirtualFile();
if (vf == null) {
return true;
}
final SVNWCClient client = myVcs.createWCClient();
try {
final SVNInfo info = client.doInfo(new File(vf.getPath()), SVNRevision.UNDEFINED);
if ((info == null) || (info.getRevision() == null)) {
return false;
}
myStartNumber = info.getRevision().getNumber();
myStartExistsKnown = true;
}
catch (SVNException e) {
return false;
}
}
return true;
}
示例10: fillMapping
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
private void fillMapping(final SvnMapping mapping, final List<SvnCopyRootSimple> list) {
final LocalFileSystem lfs = LocalFileSystem.getInstance();
for (SvnCopyRootSimple simple : list) {
final VirtualFile copyRoot = lfs.findFileByIoFile(new File(simple.myCopyRoot));
final VirtualFile vcsRoot = lfs.findFileByIoFile(new File(simple.myVcsRoot));
if (copyRoot == null || vcsRoot == null) continue;
final SvnVcs vcs = SvnVcs.getInstance(myProject);
final SVNInfo svnInfo = vcs.getInfo(copyRoot);
if ((svnInfo == null) || (svnInfo.getRepositoryRootURL() == null)) continue;
final RootUrlInfo info = new RootUrlInfo(svnInfo.getRepositoryRootURL(), svnInfo.getURL(),
SvnFormatSelector.getWorkingCopyFormat(svnInfo.getFile()), copyRoot, vcsRoot);
mapping.add(info);
}
}
示例11: getInfo
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
private SVNInfo getInfo () throws SVNException {
if (rootInfo == null) {
final SVNWCClient client = new SVNWCClient (null, null);
rootInfo = client.doInfo(getProject().getBaseDir(),
SVNRevision.WORKING);
}
return rootInfo;
}
示例12: remoteUrlExist
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
public boolean remoteUrlExist( ScmProviderRepository repository, CommandParameters parameters )
throws ScmException
{
SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repository;
String url = ( (SvnScmProviderRepository) repository ).getUrl();
try
{
javaRepo.getClientManager().getWCClient().doInfo( SVNURL.parseURIEncoded( url ), SVNRevision.HEAD,
SVNRevision.HEAD, SVNDepth.EMPTY, new ISVNInfoHandler()
{
public void handleInfo( SVNInfo svnInfo )
throws SVNException
{
svnInfo.getAuthor();
}
} );
}
catch ( SVNException e )
{
if ( e.getMessage().indexOf( "E170000" ) > -1 )
{
return false;
}
throw new ScmException( e.getMessage(), e );
}
return true;
}
示例13: getSVNReposForRevision
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
private SVNRepository getSVNReposForRevision(final SVNRepository repository, final long revision) throws SVNException {
SVNClientManager manager = SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(true), repository.getAuthenticationManager());
try {
SVNWCClient client = manager.getWCClient();
SVNInfo info1 = client.doInfo(repository.getLocation(), SVNRevision.HEAD, SVNRevision.create(revision));
SVNRepository reposForRev = SVNRepositoryFactory.create(info1.getURL());
reposForRev.setAuthenticationManager(repository.getAuthenticationManager());
return reposForRev;
}
finally {
manager.dispose();
}
}
示例14: getUrlFor
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
@Nullable
private SVNURL getUrlFor(@NotNull final FilePath root) {
try {
SVNWCClient wcClient = myVCS.createWCClient();
final SVNInfo info = wcClient.doInfo(root.getIOFile(), SVNRevision.UNDEFINED);
if (info != null) {
return info.getURL();
}
return null;
}
catch (SVNException e) {
return null;
}
}
示例15: getSourceUrl
import org.tmatesoft.svn.core.wc.SVNInfo; //导入依赖的package包/类
@Nullable
private static SVNURL getSourceUrl(final SvnVcs vcs, final File root) {
try {
SVNWCClient wcClient = vcs.createWCClient();
final SVNInfo svnInfo = wcClient.doInfo(root, SVNRevision.UNDEFINED);
if (svnInfo != null) {
return svnInfo.getURL();
} else {
return null;
}
}
catch (SVNException e) {
return null;
}
}