private void testMoveURL2URL(String srcPath, String targetFileName) throws Exception { createAndCommitParentFolders(srcPath); File file = createFile(srcPath); add(file); commit(file); File filemove = createFile(renameFile(srcPath, targetFileName)); filemove .delete(); // we're operating with repository directly, cannot leave unversioned files lying // on disk (they would be committed in the next round) ISVNClientAdapter c = getNbClient(); c.move(getFileUrl(file), getFileUrl(filemove), "move", SVNRevision.HEAD); ISVNInfo info = null; SVNClientException ex = null; try { getInfo(getFileUrl(file)); } catch (SVNClientException e) { ex = e; } assertNull(info); assertNotNull(ex); info = getInfo(getFileUrl(filemove)); assertNotNull(info); assertEquals(getFileUrl(filemove), TestUtilities.decode(info.getUrl())); assertNotifiedFiles(new File[] {}); }
private void testMoveURL2URLPrevRevision(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 filemove = createFile(renameFile(srcPath, targetFileName)); filemove .delete(); // we're operating with repository directly, cannot leave unversioned files lying // on disk (they would be committed in the next round) ISVNClientAdapter c = getNbClient(); c.copy(getFileUrl(file), getFileUrl(filemove), "move", prevRev); ISVNLogMessage[] logs = getLog(getFileUrl(filemove)); assertEquals( ((SVNRevision.Number) prevRev).getNumber(), logs[0].getChangedPaths()[0].getCopySrcRevision().getNumber()); InputStream is = getContent(getFileUrl(filemove)); assertContents(is, 1); assertNotifiedFiles(new File[] {}); }
/* (non-Javadoc) * @see org.tigris.subversion.subclipse.core.ISVNLocalFile#getKeywords() */ public SVNKeywords getKeywords() throws SVNException { ISVNClientAdapter svnClient = null; try { svnClient = getRepository().getSVNClient(); return svnClient.getKeywords(getFile()); } catch (SVNClientException e) { throw SVNException.wrapException(e); } finally { getRepository().returnSVNClient(svnClient); } }
/* (non-Javadoc) * @see org.tigris.subversion.subclipse.core.ISVNLocalFile#addKeywords(org.tigris.subversion.svnclientadapter.SVNKeywords) */ public void addKeywords(SVNKeywords svnKeywords) throws SVNException { ISVNClientAdapter svnClient = null; try { svnClient = getRepository().getSVNClient(); OperationManager.getInstance().beginOperation(svnClient); svnClient.addKeywords(getFile(), svnKeywords); } catch (SVNClientException e) { throw SVNException.wrapException(e); } finally { getRepository().returnSVNClient(svnClient); OperationManager.getInstance().endOperation(); } }
private void testMoveFile2File(String srcPath, String targetFileName) throws Exception { createAndCommitParentFolders(srcPath); File file = createFile(srcPath); add(file); commit(file); File filemove = new File(getWC(), renameFile(srcPath, targetFileName)); ISVNClientAdapter c = getNbClient(); c.move(file, filemove, true); assertTrue(filemove.exists()); assertStatus(SVNStatusKind.ADDED, filemove); if (isSvnkit()) { // no notification about target, instead "Copying target_path" comes into logMessage() assertNotifiedFiles(new File[] {file}); } else { assertNotifiedFiles(new File[] {file, filemove}); } }