本文整理汇总了Java中org.tigris.subversion.svnclientadapter.ISVNInfo类的典型用法代码示例。如果您正苦于以下问题:Java ISVNInfo类的具体用法?Java ISVNInfo怎么用?Java ISVNInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISVNInfo类属于org.tigris.subversion.svnclientadapter包,在下文中一共展示了ISVNInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPropertyFile
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private File getPropertyFile(boolean base) throws SVNClientException {
SvnClient client = Subversion.getInstance().getClient(false);
ISVNInfo info = null;
try {
info = SvnUtils.getInfoFromWorkingCopy(client, file);
} catch (SVNClientException ex) {
throw ex;
}
if(info instanceof ParserSvnInfo) {
if(base) {
return ((ParserSvnInfo) info).getBasePropertyFile();
} else {
return ((ParserSvnInfo) info).getPropertyFile();
}
} else {
return SvnWcUtils.getPropertiesFile(file, base);
}
}
示例2: recountStartRevision
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private static RevertModifications.RevisionInterval recountStartRevision(SvnClient client, SVNUrl repository, RevertModifications.RevisionInterval ret) throws SVNClientException {
SVNRevision currStartRevision = ret.startRevision;
SVNRevision currEndRevision = ret.endRevision;
if(currStartRevision.equals(SVNRevision.HEAD)) {
ISVNInfo info = client.getInfo(repository);
currStartRevision = info.getRevision();
}
long currStartRevNum = Long.parseLong(currStartRevision.toString());
long newStartRevNum = (currStartRevNum > 0) ? currStartRevNum - 1
: currStartRevNum;
return new RevertModifications.RevisionInterval(
new SVNRevision.Number(newStartRevNum),
currEndRevision);
}
示例3: checkUrlExistance
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private ISVNInfo checkUrlExistance (SvnClient client, SVNUrl url, SVNRevision revision) throws SVNClientException {
if (url == null) {
// local file, not yet in the repository
return null;
}
if (parentMissing(url, revision)) {
return null;
}
try {
return client.getInfo(url, revision, revision);
} catch (SVNClientException ex) {
if (SvnClientExceptionHandler.isWrongURLInRevision(ex.getMessage())){
cacheParentMissing(url, revision);
return null;
} else {
throw ex;
}
}
}
示例4: validateInput
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private boolean validateInput(File root, RepositoryFile toRepositoryFile) {
boolean ret = false;
SvnClient client;
try {
client = Subversion.getInstance().getClient(toRepositoryFile.getRepositoryUrl());
ISVNInfo info = client.getInfo(toRepositoryFile.getFileUrl());
if(info.getNodeKind() == SVNNodeKind.DIR && root.isFile()) {
SvnClientExceptionHandler.annotate(NbBundle.getMessage(SwitchToAction.class, "LBL_SwitchFileToFolderError"));
ret = false;
} else if(info.getNodeKind() == SVNNodeKind.FILE && root.isDirectory()) {
SvnClientExceptionHandler.annotate(NbBundle.getMessage(SwitchToAction.class, "LBL_SwitchFolderToFileError"));
ret = false;
} else {
ret = true;
}
} catch (SVNClientException ex) {
SvnClientExceptionHandler.notifyException(ex, true, true);
return ret;
}
return ret;
}
示例5: validateTargetPath
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private String validateTargetPath(CreateCopy createCopy) {
String errorText = null;
try {
RepositoryFile toRepositoryFile = createCopy.getToRepositoryFile();
SvnClient client = Subversion.getInstance().getClient(toRepositoryFile.getRepositoryUrl());
ISVNInfo info = null;
try {
info = client.getInfo(toRepositoryFile.getFileUrl());
} catch (SVNClientException e) {
if (!SvnClientExceptionHandler.isWrongUrl(e.getMessage())) {
throw e;
}
}
if (info != null) {
errorText = NbBundle.getMessage(CreateCopyAction.class, "MSG_CreateCopy_Target_Exists"); // NOI18N
}
} catch (SVNClientException ex) {
errorText = null;
}
return errorText;
}
示例6: importIntoExisting
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
/**
* Checks if the target folder already exists in the repository.
* If it does exist, user will be asked to confirm the import into the existing folder.
* @param client
* @param repositoryFileUrl
* @return true if the target does not exist or user wishes to import anyway.
*/
private boolean importIntoExisting(SvnClient client, SVNUrl repositoryFileUrl) {
try {
ISVNInfo info = client.getInfo(repositoryFileUrl);
if (info != null) {
// target folder exists, ask user for confirmation
final boolean flags[] = {true};
NotifyDescriptor nd = new NotifyDescriptor(NbBundle.getMessage(ImportStep.class, "MSG_ImportIntoExisting", SvnUtils.decodeToString(repositoryFileUrl)), //NOI18N
NbBundle.getMessage(ImportStep.class, "CTL_TargetFolderExists"), NotifyDescriptor.YES_NO_CANCEL_OPTION, //NOI18N
NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION);
if (DialogDisplayer.getDefault().notify(nd) != NotifyDescriptor.YES_OPTION) {
flags[0] = false;
}
return flags[0];
}
} catch (SVNClientException ex) {
// ignore
}
return true;
}
示例7: testCopyURL2URL
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testCopyURL2URL(String srcPath, String targetFileName) throws Exception {
createAndCommitParentFolders(srcPath);
File file = createFile(srcPath);
add(file);
commit(file);
File filecopy = createFile(renameFile(srcPath, targetFileName));
filecopy.delete();
ISVNClientAdapter c = getNbClient();
c.copy(getFileUrl(file), getFileUrl(filecopy), "copy", SVNRevision.HEAD);
ISVNInfo info = getInfo(getFileUrl(filecopy));
assertNotNull(info);
assertEquals(getFileUrl(filecopy), TestUtilities.decode(info.getUrl()));
assertNotifiedFiles(new File[] {});
}
示例8: testCopyFile2URL
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testCopyFile2URL(String srcPath, String targetFileName) throws Exception {
createAndCommitParentFolders(srcPath);
File file = createFile(srcPath);
add(file);
commit(file);
// File filecopy = new File(createFolder(file.getParentFile(), targetFileName), file.getName());
File filecopy = createFile(renameFile(srcPath, targetFileName));
ISVNClientAdapter c = getNbClient();
// c.copy(file, getFileUrl(filecopy), "copy"); XXX is failing with javahl and we don't use it anyway
c.copy(new File[] {file}, getFileUrl(filecopy), "copy", false, true);
ISVNInfo info = getInfo(getFileUrl(filecopy));
assertNotNull(info);
assertEquals(getFileUrl(filecopy), TestUtilities.decode(info.getUrl()));
assertNotifiedFiles(new File[] {});
}
示例9: testCopyFile2File
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testCopyFile2File(String srcPath, String target) throws Exception {
createAndCommitParentFolders(srcPath);
File file = createFile(srcPath);
add(file);
commit(file);
// File filecopy = new File(createFolder(file.getParentFile(), targetFileName), file.getName());
File filecopy = new File(file.getParentFile(), target);
ISVNClientAdapter c = getNbClient();
// c.copy(file, getFileUrl(filecopy), "copy"); XXX is failing with javahl and we don't use it anyway
c.copy(file, filecopy);
assertTrue(filecopy.exists());
ISVNInfo info = getInfo(filecopy);
assertNotNull(info);
assertEquals(getFileUrl(filecopy), TestUtilities.decode(info.getUrl()));
assertNotifiedFiles(new File[] {});
}
示例10: testInfoLocked
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testInfoLocked(String filePath) throws Exception {
if(!isCommandLine()) {
return;
}
createAndCommitParentFolders(filePath);
File file = createFile(filePath);
add(file);
commit(file);
String msg =
"Tamaryokucha and other types of sencha are made in essentially the same way.\n" +
"Slight differences in processing, however, give tamaryokucha its characteristic\n" +
"fresh taste and reduced astringency.";
lock(file, msg, true);
ISVNClientAdapter c = getNbClient();
ISVNInfo info1 = c.getInfo(getFileUrl(file));
ISVNInfo info2 = getInfo(getFileUrl(file));
assertTrue(info1.getLockComment().startsWith("Tamaryokucha"));
assertInfos(info1, info2);
}
示例11: testInfoCopied
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testInfoCopied(String srcFileName,
String targetFileName) throws Exception {
File file = createFile(srcFileName);
add(file);
commit(file);
File copy = new File(targetFileName);
copy(getFileUrl(file), getFileUrl(copy));
ISVNClientAdapter c = getNbClient();
ISVNInfo info1 = c.getInfo(getFileUrl(copy));
ISVNInfo info2 = getInfo(getFileUrl(copy));
assertInfos(info1, info2);
}
示例12: blameNullAuthor
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void blameNullAuthor(Annotator annotator) throws Exception {
File file = createFile("file");
add(file);
commit(file);
// 1. line
write(file, "a\n");
anoncommit(file);
ISVNInfo info = getInfo(file);
Number rev1 = info.getRevision();
ISVNAnnotations a1 = annotator.annotate(getNbClient(), file, null, null);
// test
assertEquals(1, a1.numberOfLines());
assertEquals("a", a1.getLine(0));
assertNull(a1.getAuthor(0));
// assertNull(a.getChanged(0)); is null only for svnClientAdapter
assertEquals(rev1.getNumber(), a1.getRevision(0));
}
示例13: testImportFile
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
public void testImportFile(String fileToImport, String lastUrlPart) throws Exception {
File file = createFile(fileToImport);
assertTrue(file.exists());
ISVNClientAdapter c = getNbClient();
SVNUrl url = getRepoUrl().appendPath(getName()).appendPath(lastUrlPart);
c.doImport(file, url, "imprd", false);
assertTrue(file.exists());
assertStatus(SVNStatusKind.UNVERSIONED, file);
ISVNInfo info = getInfo(url);
assertNotNull(info);
assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
assertNotifiedFiles(new File[] {file}); // XXX empty also in svnCA - why?! - no output from cli
}
示例14: testImportFolder
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
public void testImportFolder() throws Exception {
File folder = createFolder("folder");
assertTrue(folder.exists());
ISVNClientAdapter c = getNbClient();
SVNUrl url = getTestUrl().appendPath(getName());
c.mkdir(url, "mrkvadir");
url = url.appendPath(folder.getName());
c.mkdir(url, "mrkvadir");
c.doImport(folder, url, "imprd", false);
assertTrue(folder.exists());
assertStatus(SVNStatusKind.UNVERSIONED, folder);
ISVNInfo info = getInfo(url);
assertNotNull(info);
assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
assertNotifiedFiles(new File[] {}); // XXX empty also in svnCA - why?! - no output from cli
}
示例15: diff
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
@Override
public String diff( String oldCommitId, String newCommitId, String file ) {
AbstractJhlClientAdapter client = (AbstractJhlClientAdapter) svnClient;
OutputStream outStream = new ByteArrayOutputStream();
try {
String target = directory + File.separator + FilenameUtils.separatorsToSystem( file );
ISVNInfo info = svnClient.getInfoFromWorkingCopy( new File( target ) );
if ( info instanceof SVNInfoUnversioned ) {
return "Unversioned";
}
if ( info.getRevision() == null || info.isCopied() ) { // not commited yet or copied
oldCommitId = null;
}
client.getSVNClient().diff(
target,
null, resolveRevision( oldCommitId ), resolveRevision( newCommitId ),
directory.replace( "\\", "/" ), outStream, Depth.infinityOrImmediates( true ), null, true, false, false, true, false, false );
return outStream.toString().replaceAll( "\n", System.getProperty( "line.separator" ) );
} catch ( Exception e ) {
return e.getMessage();
}
}