Hi Daniel,
What do you mean by "reintegrate"? Could you send an output of
$ svn log -v <URL> -r 1:3
for that repository to understand what you exactly want?
If you want to have just linear history (and Functions.java doesn't exist in
the trunk at r1) that taks copies into account, you need to call
SVNRepository#getLocations or SVNRepository#getLocationSegments
But if you want list all merge sources for merged files, you need methods that
have
"includeMergedRevisions" parameter (e.g. SVNRepository#log or
SVNRepository#getFileRevisions).
Note that SVNRepository#getFileRevisions downloads contents of each version of
the file, but if the file is small (I expect this is true for java code) this
could be a good option for you.
Otherwise you can run SVNRepository#log with includeMergedRevisions=true and
analyze changed paths of log entries returned (this can be not so easy task).
Here's an example with "getFileRevisions"
final SVNRepository svnRepository =
SVNRepositoryFactory.create(url);
try {
svnRepository.getFileRevisions("/branches/FOT000002/java/Functions.java", 1, 3,
true, new ISVNFileRevisionHandler() {
@Override
public void openRevision(SVNFileRevision fileRevision)
throws SVNException {
final String path = fileRevision.getPath();
System.out.println("path = " + path);
long revision = fileRevision.getRevision();
System.out.println("revision = " + revision);
}
@Override
public void closeRevision(String token) throws SVNException
{
}
@Override
public void applyTextDelta(String path, String
baseChecksum) throws SVNException {
}
@Override
public OutputStream textDeltaChunk(String path,
SVNDiffWindow diffWindow) throws SVNException {
return null;
}
@Override
public void textDeltaEnd(String path) throws SVNException {
}
});
} finally {
svnRepository.closeSession();
}
--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
> Hi folks,
>
> Suppose that i have a Java class named Functions.java
>
> first i had Functions.java in a branch called:
>
> /branches/FOT000001/java/Functions.java
>
> Then i have reintegrated it to the trunk
>
> /trunk/java/Functions.java
>
> Later, i created another branch with this archive
>
> branches/FOT000002/java/Functions.java
>
>
> Is there a way to know all the paths a file have passed?
>
> For example, a method that would return something like:
>
> {[path="/branches/FOT000001/java/Functions.java",
> rev=1],[path="/trunk/java/Functions.java",
> rev=2],[path="branches/FOT000002/java/Functions.java", rev=3] }
>
> Thanks.