Hello Justin,

To compute a user-friendly diff between two revisions of a file you
always need a full contents of the file at those revisions. Delta that
is sent to the ISVNEditor is in binary form and cannot be translated
into something user may use (like GNU diff), however that delta may be
used to get a full-text version of a file.

So, there are few ways to get full contents of a file at two revisions
(rN and rM). I assume you only use low-level API (SVNRepository)

1.

- Get contents of a file at rN. You may use SVNRepository.getFile(...)
method and save file to a temporary location on keep it in memory.
- Get contents of a file at rM. Same as above.
- Compare these two files to generate a textual diff. You may use
sequence library which is part of SVNKit.

2.

- Get contents of a file at rN. You may use SVNRepository.getFile(...)
method and save file to a temporary location on keep it in memory.
- Run update for that file (SVNRepository.update(...), receive binary
delta in your  ISVNEditor implementation and apply it to the rN
version you have to get an rM version. You will have to use
SVNDeltaProcessor class to apply delta.

- Compare these two files to generate a textual diff. You may use
sequence library which is part of SVNKit.

Second way might be slightly faster, as delta is usually smaller than
full contents of a file. However, when update is performed for a
single file, then additional requests overhead may minimize the
benefits (unless file is very large).

So in case you only need to generate diff for one file then I would
use the first approach, or even just call SVNDiffClient.doDiff for URL
and two revisions.

Update approach will improve performance only when you need to receive
multiple files contents at certain revision.

Alexander Kitaev,
TMate Software,
http://subgit.com/ - Svn to Git Migration!
http://svnkit.com/ - Java [Sub]Versioning Library!
http://hg4j.com/ - Java Mercurial Library!
http://sqljet.com/ - Java SQLite Library!


On 27 June 2012 18:12, mccoyjus <mccoy...@gmail.com> wrote:
>
> Howdy,
>
> I am trying to identify the changes between two revisions on a file working
> only with the remote repository.  I have accomplished this using the
> SVNDiffClient parsing out the changed LOC data but this is terribly slow and
> inefficient.  Reading through some existing SVNKit forums it was suggested
> to perform an update and calculate the delta between the two revisions.
> This however was only for comparisons using local copies of the file in
> question.
>
> Are there any examples of performing an update using only remote copies of a
> file?  I have looked at the SVNReporter and the ISVNEditor examples but it
> seems to only work while comparing local changes to the remote repository.
>
> Is it possible to find the delta between two revisions of remote repository
> files?  If it is I am looking for some guidance.
>
> best,
>
> Justin
> --
> View this message in context: 
> http://old.nabble.com/Obtaining-deltas-between-two-revisions-both-on-remote-repository-tp34081400p34081400.html
> Sent from the SVNKit - Users mailing list archive at Nabble.com.
>
>

Reply via email to