Hello Dan,
The following code works fine for me:
DAVRepositoryFactory.setup();
SVNDiffClient diffClient =
SVNClientManager.newInstance().getDiffClient();
SVNURL url =
SVNURL.parseURIEncoded("
http://svn.svnkit.com/repos/svnkit/trunk");
SVNRevision rN = SVNRevision.HEAD;
SVNRevision rM = SVNRevision.create(6122);
diffClient.doDiffStatus(url, rN, url, rM,
SVNDepth.INFINITY, true, new ISVNDiffStatusHandler() {
public void handleDiffStatus(SVNDiffStatus diffStatus)
throws SVNException {
System.out.println(diffStatus.getModificationType().getCode() + " " +
diffStatus.getPath());
}
});
> 1. What is the parameter File path2 ?
> I think if I get the base URL+Revision and the comparing URL+Revision,
> that is enough, isn't it?
doDiffStatus (equivalent of Subversion command "diff --summarize") may
use second URL for comparison from the working copy at path. There are
other methods with different signatures for this operation, in
particular one used above that accepts two URLs and two revisions to
compare one with another.
> 2. If I don't want to specify the Revision, just use the HEAD Revision.
> I thought I could use '-1' as the default for HEAD because I remember I
> use '-1' before in other API which works well. But for this function ,
> '-1' does NOT work, it returns a null
Use SVNRevision.HEAD constant as a revision value for HEAD revision.
Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://sqljet.com/ - Java SQLite Library!
Dan HE wrote:
> Hi Alex and all,
>
> I have a question on how to get the changed file list by provide two URL
> + Revision
>
> I get the API below:
> *doDiffStatus*
> <
http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/SVNDiffClient.html#doDiffStatus(org.tmatesoft.svn.core.SVNURL,
> org.tmatesoft.svn.core.wc.SVNRevision, java.io.File,
> org.tmatesoft.svn.core.wc.SVNRevision, boolean, boolean,
> org.tmatesoft.svn.core.wc.ISVNDiffStatusHandler)>(SVNURL
> <
http://svnkit.com/javadoc/org/tmatesoft/svn/core/SVNURL.html> url1,
> SVNRevision
> <
http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/SVNRevision.html> rN,
> File <
http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html> path2,
> SVNRevision
> <
http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/SVNRevision.html> rM,
> boolean recursive, boolean useAncestry, ISVNDiffStatusHandler
> <
http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/ISVNDiffStatusHandler.html> handler)
>
> *Deprecated.* /use |doDiffStatus(SVNURL, SVNRevision, File,
> SVNRevision, SVNDepth, boolean, ISVNDiffStatusHandler)|
> <
http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/SVNDiffClient.html#doDiffStatus(org.tmatesoft.svn.core.SVNURL,
> org.tmatesoft.svn.core.wc.SVNRevision, java.io.File,
> org.tmatesoft.svn.core.wc.SVNRevision, org.tmatesoft.svn.core.SVNDepth,
> boolean, org.tmatesoft.svn.core.wc.ISVNDiffStatusHandler)> instead/
>
>
> My Questions are:
> 1. What is the parameter File path2 ?
> I think if I get the base URL+Revision and the comparing URL+Revision,
> that is enough, isn't it?
>
> 2. If I don't want to specify the Revision, just use the HEAD Revision.
> I thought I could use '-1' as the default for HEAD because I remember I
> use '-1' before in other API which works well. But for this function ,
> '-1' does NOT work, it returns a null
> org.tmatesoft.svn.core.SVNException: svn: Both rN and rM revisions
> should be specified
> How can I get the HEAD Revision?
>
>
>
>
>
> Thanks and Regards
> -Dan
---------------------------------------------------------------------
To unsubscribe, e-mail:
svnkit-users-unsubscribe@...
For additional commands, e-mail:
svnkit-users-help@...