Hello, Construction of a second repository object for checkPath() calls is the best thing you can do for your case.
repository.getCommitEditor(msg, null) call starts a transaction and this repository object can't be used until the transaction is finished (repository.closeEdit()) or rolled back (repository.abortEdit()). The same is true about other SVNRepository methods. even read only. For example you can't use the same 'repository' object in editors or callbacks that you pass to repository.update(), repository.log() or any other SVNRepository methods. -- Dmitry Pavlenko, TMate Software, http://subgit.com/ - git-svn bridge > Well, so I'm getting this error: > > Exception in thread "main" java.lang.Error: SVNRepository methods are not > reenterable > at > org.tmatesoft.svn.core.io.SVNRepository.lock(SVNRepository.java:2820) > at > org.tmatesoft.svn.core.io.SVNRepository.lock(SVNRepository.java:2811) > at > org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepo > sitory.java:1011) at > org.tmatesoft.svn.core.internal.io.dav.DAVRepository.checkPath(DAVRepositor > y.java:219) > > What I'm trying to do is implement something similar to and import. I have > a file that contains a list of files that need to be > put in the repository. I would like to do them all with one revision. So, > I have the following code: > > repository = SVNRepositoryFactory.create (url); > latestRevision = repository.getLatestRevision(); > ISVNEditor editor = repository.getCommitEditor(msg, null); > editor.openRoot(-1); > while ((rec = buffReader.readLine()) != null) { > // Pull the filename out of rec. > // Construct the following variables > // dirPath = "Folder" > // filePath = "Folder/Filename.txt" > // modifiedContents = <a byte array containing contents of file> > nodeKind = repository.checkPath (dirPath, -1); // "Folder" <== This dies > immediately > if (nodeKind == SVNNodeKind.NONE) { > editor.addDir (dirPath, null, -1); > nodeKind = repository.checkPath(filePath, -1); > boolean fileIsInRepository = (nodeKind==SVNNodeKind.FILE); > if (fileIsInRepository) { > SVNProperties props = new SVNProperties(); > repository.getFile(filePath > ,-1 > ,props > ,existingStream > ); > contents = existingStream.toByteArray(); > // contents now has the data from the repository > } > } > editor.openDir (dirPath, -1); > editor.addFile (filePath, null, -1); > editor.applyTextDelta (filePath, null); > SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator > (diffWindowSize); > > String checksum = null; > if (fileIsInRepository) { > checksum = deltaGenerator.sendDelta(filePath > ,new ByteArrayInputStream (contents) > ,0 > ,new ByteArrayInputStream (modifiedContents) > ,editor > ,true // generateChecksum > ); > } else { > checksum = deltaGenerator.sendDelta (filePath > ,new ByteArrayInputStream (modifiedContents) > ,editor > ,true // generateChecksum > ); > } > // Multiple editor.changeFileProperty calls > editor.closeFile (filePath, checksum); > editor.closeDir(); > } // while > > editor.closeDir(); > editor.closeEdit(); > latestRevision = repository.getLatestRevision(); > > > One idea I had was to construct a second repository object > (inquiryRepository) that is > just used for my "checkPath" calls. > > But I thought I would check with the group first. Is there any info > written up somewhere > that talks about re-entrance and its implications? > > Don Payette > FSS19 Production Management > Contractor for the GSA FAME Program > 2345 Crystal Dr. Suite 250, Rm 208A. > (w) 703-236-3523 > (c) 571-305-0105 > (h) 479-437-3084 - telework Monday and Wednesday > Internal only extension 7706