Hello Daniel,

You see this exception because /jakarta/jmeter doesn't exist at HEAD revision.

You call SvnTarget.fromURL() method, but you don't specify peg revision. By 
default HEAD revision is 
used as peg revision. You can read more about peg revision here:

http://www-rohan.sdsu.edu/doc/svn-book-html-chunk/svn.advanced.pegrevs.html

To solve the problem you can call
SvnTarget.fromURL(urlOfJakartaJmeter, pegRevisionWhereJakartaJmeterExisted)


But actually, if "/jmeter" was copied from "/jakarta/jmeter" you can just run 
log on "/jmeter" and 
log entries for "/jakarta/jmeter" will also be shown (unless you specify 
log.setStopOnCopy(true); 
explicitly).

For example you have the following repository

------------------------------------------------------------------------
r2 | (no author) | 2013-11-13 13:01:24 +0100 (Wed, 13 Nov 2013) | 1 line
Changed paths:
   D /jakarta/jmeter
   A /jmeter (from /jakarta/jmeter:1)


------------------------------------------------------------------------
r1 | (no author) | 2013-11-13 13:01:24 +0100 (Wed, 13 Nov 2013) | 1 line
Changed paths:
   A /jakarta
   A /jakarta/jmeter


------------------------------------------------------------------------

This code
            final SvnLog log = svnOperationFactory.createLog();
            log.setSingleTarget(SvnTarget.fromURL(url.appendPath("jmeter", 
false)));
            log.setReceiver(new ISvnObjectReceiver<SVNLogEntry>() {
                @Override
                public void receive(SvnTarget target, SVNLogEntry logEntry) 
throws SVNException {
                    System.out.println(logEntry.getRevision());
                }
            });
            
log.setRevisionRanges(Collections.singleton(SvnRevisionRange.create(SVNRevision.create(0),
 
SVNRevision.HEAD)));
            log.run();

will output
1
2
although "/jmeter" didn't exist in r1. If you set log.setStopOnCopy(true);

            final SvnLog log = svnOperationFactory.createLog();
            log.setSingleTarget(SvnTarget.fromURL(url.appendPath("jmeter", 
false)));
            log.setReceiver(new ISvnObjectReceiver<SVNLogEntry>() {
                @Override
                public void receive(SvnTarget target, SVNLogEntry logEntry) 
throws SVNException {
                    System.out.println(logEntry.getRevision());
                }
            });
            
log.setRevisionRanges(Collections.singleton(SvnRevisionRange.create(SVNRevision.create(0),
 
SVNRevision.HEAD)));
            log.setStopOnCopy(true);
            log.run();
the output will contain only r2
2

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge

> Hi Everyone,
> 
> I have been trying to find a way to retrieve all the logs from a specific
> apache project, for example the JMeter.
> 
> I also found that JMeter used to have the path of */jakarta/jmeter* and
> then it changed to */jmeter/* only.
> 
> I have been using the following code:
> 
> *for (String path : paths)*
> * {*
> * SvnLog log = svnOperationFactory.createLog();*
> * // log.setTargetPaths(paths);*
> 
> *
> log.addTarget(SvnTarget.fromURL(SVNURL.parseURIEncoded(connector.getRepoUrl
> ()* * + path)));*
> 
> * log.addRange(SvnRevisionRange.create(SVNRevision.create(dataInicio),*
> * SVNRevision.create(dataFim)));*
> * log.setDiscoverChangedPaths(true);*
> * log.setDepth(SVNDepth.INFINITY);*
> * log.setUseMergeHistory(true);*
> * log.run(svnLogEntries);*
> * }*
> 
> where path is an array containing the two paths
> {"jmeter/","jakarta/jmeter"}. The code retrieves all the logs from the path
> "jmeter/" (which are 2125 logs) however when it tries to get the logs from
> path "jakarta/jmeter" i get the following exception:
> 
> *org.tmatesoft.svn.core.SVNException: svn: E160013:
> '/repos/asf/!svn/bc/1541295/jakarta/jmeter' path not found: 404 Not Found
> (http://svn.apache.org <http://svn.apache.org>)*
> * at
> org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.ja
> va:64)* * at
> org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.ja
> va:51)* * at
> org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLocationsImpl(DAVRe
> pository.java:1064)* * at
> org.tmatesoft.svn.core.io.SVNRepository.getLocations(SVNRepository.java:108
> 8)* * at
> org.tmatesoft.svn.core.io.SVNRepository.getLocations(SVNRepository.java:151
> 6)* * at
> org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRep
> ositoryAccess.java:178)* * at
> org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createReposito
> ryFor(SvnNgRepositoryAccess.java:45)* * at
> org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.ja
> va:160)* * at
> org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.ja
> va:35)* * at
> org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunn
> er.java:20)* * at
> org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java
> :1235)* * at
> org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:291)* * at
> org.tmatesoft.svn.core.wc2.SvnReceivingOperation.run(SvnReceivingOperation.
> java:112)* * at
> br.ufrn.backhoe.repminer.miner.ComplexCodeMiner.findCommits(ComplexCodeMine
> r.java:108)* * at
> br.ufrn.backhoe.repminer.miner.ComplexCodeMiner.performMining(ComplexCodeMi
> ner.java:77)* * at
> br.ufrn.backhoe.repminer.miner.Miner.executeMining(Miner.java:27)* * at
> br.ufrn.backhoe.repminer.ui.ComplexCodeMinerUI.main(ComplexCodeMinerUI.java
> :49)*
> 
> I'm sure the that path have already existed, but I'm afraid that retrieving
> ALL the logs from apache svn repository is the only way to get those
> logs... Do you have any idea of how to get the logs when the project used
> to have the path "jakarta/jmeter"?
> 
> All the best,

Reply via email to