On Tue, Nov 18, 2008 at 12:50 PM, Bharat Khatri <bharatkhatri_at_gmail.com> wrote:
> I'm using the svnClientAdapter API in my application (with JavaHL
> underneath). Most of the functionality works great but I need help on the
> following issue:
>
> 1. Basically what I want to do is to get the contents of a file at a
> specific revision. So for example, if a file has path
> http://mysvn/myrepo/mydir1/mydir2/file1.c in revision 200 of the repository,
> I want to get the contents of this file at revision 99. I did not find a way
> through the API to do this directly. It seems that the only way is to get
> the path of the file at revision 99, and then call getContents() method with
> the discovered path and revision 99. There isn't an API method to find the
> path of a file at a specific revision either.
>
> What I'm doing right now is to get the complete revision history of the file
> (along with changed paths), and then parse the information in changed paths
> to figure out the path at a specific revision. Although this works for me,
> it has a performance overhead since I'm getting the whole revision history
> (and changed paths too).
>
> Any help or advice would be greatly appreciated.
What svnClientAdapter can do, or cannot do, is dictated by the
underlying JavaHL API. So what you would need to do is look at the
JavaHL API and see if it offers a way to do what you want or not. If
it does, and we have not exposed an equivalent in svnClientAdapter,
then you should be able to supply a patch that does expose it fairly
easily.
All that said, this API should do what you need:
public InputStream getContent(SVNUrl url, SVNRevision revision,
SVNRevision pegRevision)
the url and pegRevision need to specify a known point in time where
the item existed. So for example, if you know the current URL, then
you would pass HEAD for the pegRevision. The revision argument should
then be the revision of the file that you want. If it existed at a
different URL at that revision then Subversion will trace the history
by starting at the URL/pegRevision you gave it and then return the
proper file content.
--
Thanks
Mark Phippard
http://markphip.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subclipse.tigris.org
For additional commands, e-mail: users-help_at_subclipse.tigris.org
Received on 2008-11-18 18:58:30 CET