Hello Daniel,
To solve the task, you should translate it to SVN language of directories and 
reivisons. You have a 
directory:

branches/branchName

at some revision (r4). If you don't know "branches/branchName" path, you can 
get "svn log" for that 
revision to get changed paths. See SvnOperationFactory#createLog() for that.


Then you want to find a directory of form

tags/*

that was copied from branches/branchName@4.


The algorithm (I believe it's the easiest one):

1. List "tags" directory. To do that use 

SvnOperationFactory#createList()

This will give you the all tag directories

tags/tag1
tags/tag2
...
tags/tagN

2. For each tags/tag directory run "svn log" on it to with limit=1 and 
stopOnCopy=true to get the 
first revision (the revision where it was created by copying) in its history.

You can use SvnOperationFactory#createLog()  and resulting

SvnLog#run() will give you that SVNLogEntry with changed paths map.

3. You should analyze changed paths in that SVNLogEntry to find SVNLogEntryPath 
instance that 
corresponds to 

A /tags/tag (copy from branches/branchName@REV)

If this line is absent, you should discard that tag.

4. Use "svn info" to get latest changed revision of branches/branchName@REV.
If it is 4, the tag you've found is that tag you need (you can find the 
revision from 
SVNLogEntry#getRevision() of step 2). To run "svn info" use 

SvnOperationFactory#createGetInfo()


All of that is not a piece of cake (note that in log entries only absolute 
paths are used). So I 
wish you good luck.

If you're advanced SVNKit user, you can use SVNRepository#getLocations() / 
SVNRepository#getLocationSegments(), this is more reliable approach, but it is 
harder to use.
--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge

> Hi Everyone,
> 
> Lets say I have a revision like this
> 
> revision #4 (2010-05-05)
> A - fileb.java
> M - filec.java
> 
> ​Then, somewhere​
> ​ in the future​
> ​, lets say (2010-05-29), this revision is tagged as release-1.0.
> 
> Is there a way for me, using SVNKit, to discover if a given revision was
> tagged and then to get the metadata of the tag? for instance, the date of
> the tag?
> 
> With regards,
> ​

Reply via email to