Thanks, Dmitri.  I've moved down to my next problem, now. :-)

I'm doing this sequence:

editor.addDir 'COBOL74'
Do checkPath on file 'COBOL74/FD_D000AUD1.c74_m'
editor.openDir 'COBOL74'
editor.addFile 'COBOL74/FD_D000AUD1.c74_m'
editor.applyTextDelta  'COBOL74/FD_D000AUD1.c74_m'
deltaGenerator.sendDelta  'COBOL74/FD_D000AUD1.c74_m'
editor.closeFile 'COBOL74/FD_D000AUD1.c74_m'

And I get the following exception.  It looks like it is putting my
directory node on twice "COBOL74/COBOL74" instead of just "COBOL74".

org.tmatesoft.svn.core.SVNException: svn: E160013: File not found:
transaction '11-g',path/COBOL74/COBOL74/FD_D000AUD1.c74_m'
svn: E160013: '/FSS19test/!svn/wrk/eef0ddde-3901-0010-8918-b15082b6a7fd/
COBOL74/COBOL74/FD_D000AUD1.c74_m' path not found: 404 Not Found (
http://myserver.com)

   at
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)

   at
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)

   at
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:657)

   at
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:290)

   at
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:716)

   at
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doPutDiff(DAVConnection.java:505)

   at
org.tmatesoft.svn.core.internal.io.dav.DAVCommitEditor.closeFile(DAVCommitEditor.java:335)

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




On Wed, Sep 19, 2012 at 9:40 AM, Dmitry Pavlenko <pavle...@tmatesoft.com>wrote:

> 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
>

Reply via email to