本文整理汇总了Java中org.tigris.subversion.svnclientadapter.SVNRevision类的典型用法代码示例。如果您正苦于以下问题:Java SVNRevision类的具体用法?Java SVNRevision怎么用?Java SVNRevision使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVNRevision类属于org.tigris.subversion.svnclientadapter包,在下文中一共展示了SVNRevision类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCopyURL2File
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCopyURL2File(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), filecopy, SVNRevision.HEAD);
assertTrue(filecopy.exists());
assertStatus(SVNStatusKind.ADDED, filecopy);
if (isSvnkit()) {
// svnkit does not notify about files
assertNotifiedFiles(new File[] {});
} else {
assertNotifiedFiles(new File[] {filecopy});
}
}
示例2: getStagedFiles
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
@Override
public List<UIFile> getStagedFiles( String oldCommitId, String newCommitId ) {
List<UIFile> files = new ArrayList<UIFile>();
try {
Arrays.stream( svnClient.diffSummarize( svnClient.getInfoFromWorkingCopy( root ).getUrl(), null, new SVNRevision.Number( Long.parseLong( oldCommitId ) ),
new SVNRevision.Number( Long.parseLong( newCommitId ) ),
100, true ) )
.forEach( diffStatus -> {
files.add( new UIFile( diffStatus.getPath().replaceFirst( directory.replace( "\\", "\\\\" ), "" ),
convertTypeToGit( diffStatus.getDiffKind().toString() ), false ) );
}
);
} catch ( Exception e ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
}
return files;
}
示例3: pull
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
@Override
public boolean pull() {
try {
SVNRevision.Number lastRevision = svnClient.getInfoFromWorkingCopy( root ).getRevision();
long newLastRevision = svnClient.update( root, SVNRevision.HEAD, true );
if ( lastRevision.getNumber() == newLastRevision ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), "Up-to-date" );
} else {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), BaseMessages.getString( PKG, "Dialog.Success" ) );
}
return true;
} catch ( SVNClientException e ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
}
return false;
}
示例4: testListFiles
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public void testListFiles() throws Exception {
File file1 = createFile("file1");
File file2 = createFile("file2");
File file3 = createFile("file3");
add(file1);
add(file2);
add(file3);
commit(getWC());
ISVNDirEntry[] entries1 = getNbClient().getList(getTestUrl().appendPath(getWC().getName()), SVNRevision.HEAD, false);
assertEquals(3, entries1.length);
ISVNDirEntry[] entries2 = getFullWorkingClient().getList(getTestUrl().appendPath(getWC().getName()), SVNRevision.HEAD, false);
assertEntryArrays(entries1, entries2);
}
示例5: selectItem
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void selectItem (JComboBox cmbDiffTree, SVNRevision revision) {
Object toSelect = null;
if (fileUrl != null) {
DefaultComboBoxModel model = (DefaultComboBoxModel) cmbDiffTree.getModel();
for (int i = 0; i < model.getSize(); ++i) {
Object o = model.getElementAt(i);
if (o instanceof RepositoryFile) {
RepositoryFile inModel = (RepositoryFile) o;
if (inModel.getFileUrl().equals(fileUrl) && revision.equals(inModel.getRevision())) {
toSelect = o;
break;
}
}
}
}
if (toSelect != null) {
cmbDiffTree.setSelectedItem(toSelect);
}
}
示例6: testCommitFile
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCommitFile(String path) throws Exception {
createAndCommitParentFolders(path);
File file = createFile(path);
add(file);
assertStatus(SVNStatusKind.ADDED, file);
SVNRevision revisionBefore = (SVNRevision.Number) getRevision(getRepoUrl());
ISVNClientAdapter client = getNbClient();
long r = client.commit(new File[] {file}, "commit", true);
SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());
assertTrue(file.exists());
assertStatus(SVNStatusKind.NORMAL, file);
assertNotSame(revisionBefore, revisionAfter);
assertEquals(((SVNRevision.Number)revisionAfter).getNumber(), r);
assertNotifiedFiles(file);
}
示例7: testCommitFolder
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCommitFolder(String folderName, String fileName) throws Exception {
File folder = createFolder(folderName);
File file = createFile(folder, fileName);
add(folder);
assertStatus(SVNStatusKind.ADDED, file);
assertStatus(SVNStatusKind.ADDED, folder);
SVNRevision revisionBefore = (SVNRevision.Number) getRevision(getRepoUrl());
ISVNClientAdapter client = getNbClient();
long r = client.commit(new File[] {folder}, "commit", true);
SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());
assertTrue(file.exists());
assertStatus(SVNStatusKind.NORMAL, file);
assertStatus(SVNStatusKind.NORMAL, folder);
assertNotSame(revisionBefore, revisionAfter);
assertEquals(((SVNRevision.Number)revisionAfter).getNumber(), r);
assertNotifiedFiles(new File[] {file, folder});
}
示例8: rollback
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
@Override
public boolean rollback( String name ) {
if ( !isClean() ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), "Dirty working-tree" );
return false;
}
try {
svnClient.merge( new SVNUrl( getRemote() ),
null,
new SVNRevisionRange[] { new SVNRevisionRange(
svnClient.getInfoFromWorkingCopy( root ).getRevision(),
new SVNRevision.Number( Long.parseLong( name ) )
) },
root,
false, 100, true, false, false );
return true;
} catch ( Exception e ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
}
return false;
}
示例9: RepositoryFile
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public RepositoryFile(SVNUrl repositoryUrl, String[] pathSegments, SVNRevision revision) throws MalformedURLException {
this(repositoryUrl, revision);
this.pathSegments = pathSegments;
repositoryRoot = pathSegments == null;
if(!repositoryRoot) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < pathSegments.length; i++) {
sb.append(pathSegments[i]);
if(i<pathSegments.length-1) {
sb.append("/"); // NOI18N
}
}
path = sb.toString();
fileUrl = repositoryUrl.appendPath(path);
}
}
示例10: testSwitchToFile
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public void testSwitchToFile() throws Exception {
File file = createFile("file");
add(file);
commit(file);
File filecopy = createFile("filecopy");
ISVNClientAdapter c = getNbClient();
c.copy(getFileUrl(file), getFileUrl(filecopy), "copy", SVNRevision.HEAD);
assertCopy(getFileUrl(filecopy));
assertInfo(file, getFileUrl(file));
c.switchToUrl(file, getFileUrl(filecopy), SVNRevision.HEAD, false);
assertInfo(file, getFileUrl(filecopy));
assertNotifiedFiles();// XXX empty also in svnCA - why?! - no output from cli
}
示例11: getResortedRevisionInterval
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private RevisionInterval getResortedRevisionInterval(SVNRevision revision1, SVNRevision revision2) {
RevisionInterval ret;
if(revision1.equals(SVNRevision.HEAD) && revision1.equals(SVNRevision.HEAD)) {
ret = new RevisionInterval (revision1, revision2);
} else if (revision1.equals(SVNRevision.HEAD)) {
ret = new RevisionInterval (revision2, revision1);
} else if (revision2.equals(SVNRevision.HEAD)) {
ret = new RevisionInterval (revision1, revision2);
} else {
Long r1 = Long.parseLong(revision1.toString());
Long r2 = Long.parseLong(revision2.toString());
if(r1.compareTo(r2) < 0) {
ret = new RevisionInterval (revision1, revision2);
} else {
ret = new RevisionInterval (revision2, revision1);
}
}
return ret;
}
示例12: testDiffSame
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public void testDiffSame () throws Exception {
// init
File folder = new File(wc, "folder");
File file = new File(folder, "file");
folder.mkdirs();
file.createNewFile();
add(folder);
commit(folder);
RepositoryFile left = new RepositoryFile(repoUrl, wc.getName() + "/folder", SVNRevision.HEAD);
RepositoryFile right = new RepositoryFile(repoUrl, wc.getName() + "/folder", SVNRevision.HEAD);
final RevisionSetupsSupport revSupp = new RevisionSetupsSupport(left, right, repoUrl, new Context(folder));
final AtomicReference<Setup[]> ref = new AtomicReference<>();
new SvnProgressSupport() {
@Override
protected void perform () {
ref.set(revSupp.computeSetupsBetweenRevisions(this));
}
}.start(RequestProcessor.getDefault(), repoUrl, "bbb").waitFinished();
Setup[] setups = ref.get();
assertNotNull(setups);
assertEquals(0, setups.length);
}
示例13: testCheckoutFolder
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCheckoutFolder(String repoFolderName,
String targetFolderName) throws Exception {
File cifolder = createFolder(repoFolderName);
File folder1 = createFolder(cifolder, "folder1");
File file = createFile(folder1, "file");
importFile(cifolder);
File checkout = createFolder(targetFolderName);
SVNUrl url = getTestUrl().appendPath(cifolder.getName());
ISVNClientAdapter c = getNbClient();
c.checkout(url, checkout, SVNRevision.HEAD, true);
File chFolder1 = new File(checkout, folder1.getName());
File chFile = new File(chFolder1, file.getName());
assertTrue(chFolder1.exists());
assertTrue(chFile.exists());
assertStatus(SVNStatusKind.NORMAL, checkout);
assertStatus(SVNStatusKind.NORMAL, chFolder1);
assertStatus(SVNStatusKind.NORMAL, chFile);
assertNotifiedFiles(new File[] {chFolder1, chFile});
}
示例14: testCopyURL2FilePrevRevision
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCopyURL2FilePrevRevision(String srcPath,
String targetFileName) throws Exception {
createAndCommitParentFolders(srcPath);
File file = createFile(srcPath);
write(file, 1);
add(file);
commit(file);
SVNRevision prevRev = getRevision(file);
write(file, 2);
commit(getWC());
File filecopy = createFile(renameFile(srcPath, targetFileName));
filecopy.delete();
ISVNClientAdapter c = getNbClient();
c.copy(getFileUrl(file), filecopy, prevRev);
assertContents(filecopy, 1);
if (isSvnkit()) {
// svnkit does not notify about files
assertNotifiedFiles(new File[] {});
} else {
assertNotifiedFiles(new File[] {filecopy});
}
}
示例15: merge
import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
@Override
public boolean merge() {
String name = null;
List<String> names = getBranches();
EnterSelectionDialog esd = new EnterSelectionDialog( shell, names.toArray( new String[names.size()] ),
"Select Branch", "Select the branch to be merged (reintegrated) into the current working copy" );
name = esd.open();
if ( name == null ) {
return false;
}
try {
svnClient.mergeReintegrate( new SVNUrl( getRemoteRoot() + File.separator + name ),
SVNRevision.HEAD, root, false, false );
return true;
} catch ( Exception e ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
}
return false;
}