Listing files changed between tag and branch?

View: New views
3 Messages — Rating Filter:   Alert me  

Listing files changed between tag and branch?

by ajmas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I took a look at the example here:

https://wiki.svnkit.com/Printing_Out_Repository_History

and at the SVNRepository.log() command, but I am still not sure how to use SVNKit to list the changes between a tag and the latest revision in the branch. For example:

  list all changes [branch] [tag]

What I am looking to do is be able to list all the files that changed between the two comparison points and then list the comments associated with those changes. With this I am hoping to be able create a manifest of changes.

Any help would be appreciated.

Andre

Re: Listing files changed between tag and branch?

by ajmas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I finally came up with this, though I don't know if this is 100% right:

String tagPath = "myproject/tags/2.1.2";
String trunkPath = "myproject/trunk";
           
SVNDirEntry taggedEntry = repository.info(tagPath, -1);            
SVNDirEntry trunkEntry = repository.info(trunkPath, -1);
           
Collection<SVNLogEntry> entries = repository.log(new String[] { trunkPath },
                null, taggedEntry.getRevision(),
                trunkEntry.getRevision(),
                true, true);

Map<String,List<SVNLogEntry>> changesByFileMap = new HashMap<String,List<SVNLogEntry>>();
           
for ( SVNLogEntry entry : entries ) {
       
        Set<String> pathSet = entry.getChangedPaths().keySet();
        for ( String path : pathSet ) {
    List<SVNLogEntry> entryList = changesByFileMap.get(path);
    if ( entryList == null ) {
    entryList = new ArrayList<SVNLogEntry>();
    changesByFileMap.put( path, entryList );
    }
    entryList.add( entry );
        }
}

Set<String> pathSet = changesByFileMap.keySet();
for ( String path : pathSet ) {
        System.out.println( "Path: " + path);
        List<SVNLogEntry> entryList = changesByFileMap.get(path);

        for ( SVNLogEntry logEntry : entryList ) {
                System.out.println( "  Revision: " + logEntry.getRevision() );
        }
        System.out.println( );
}

ajmas wrote:
Hi,

I took a look at the example here:

https://wiki.svnkit.com/Printing_Out_Repository_History

and at the SVNRepository.log() command, but I am still not sure how to use SVNKit to list the changes between a tag and the latest revision in the branch. For example:

  list all changes [branch] [tag]

What I am looking to do is be able to list all the files that changed between the two comparison points and then list the comments associated with those changes. With this I am hoping to be able create a manifest of changes.

Any help would be appreciated.

Andre

Re: Listing files changed between tag and branch?

by Alexander Sinyushkin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello ajmas,

If the aim is to get all revisions for each path where it was changed
since creation of a tag, then it looks quite correct :)
----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

ajmas wrote:

> Hi,
>
> I finally came up with this, though I don't know if this is 100% right:
>
> String tagPath = "myproject/tags/2.1.2";
> String trunkPath = "myproject/trunk";
>            
> SVNDirEntry taggedEntry = repository.info(tagPath, -1);            
> SVNDirEntry trunkEntry = repository.info(trunkPath, -1);
>            
> Collection<SVNLogEntry> entries = repository.log(new String[] { trunkPath },
> null, taggedEntry.getRevision(),
> trunkEntry.getRevision(),
> true, true);
>
> Map<String,List<SVNLogEntry>> changesByFileMap = new
> HashMap<String,List<SVNLogEntry>>();
>            
> for ( SVNLogEntry entry : entries ) {
>
> Set<String> pathSet = entry.getChangedPaths().keySet();
> for ( String path : pathSet ) {
>     List<SVNLogEntry> entryList = changesByFileMap.get(path);
>     if ( entryList == null ) {
>     entryList = new ArrayList<SVNLogEntry>();
>     changesByFileMap.put( path, entryList );
>     }
>     entryList.add( entry );
> }
> }
>
> Set<String> pathSet = changesByFileMap.keySet();
> for ( String path : pathSet ) {
> System.out.println( "Path: " + path);
> List<SVNLogEntry> entryList = changesByFileMap.get(path);
>
> for ( SVNLogEntry logEntry : entryList ) {
> System.out.println( "  Revision: " + logEntry.getRevision() );
> }
> System.out.println( );
> }
>
>
> ajmas wrote:
>> Hi,
>>
>> I took a look at the example here:
>>
>> https://wiki.svnkit.com/Printing_Out_Repository_History
>>
>> and at the SVNRepository.log() command, but I am still not sure how to use
>> SVNKit to list the changes between a tag and the latest revision in the
>> branch. For example:
>>
>>   list all changes [branch] [tag]
>>
>> What I am looking to do is be able to list all the files that changed
>> between the two comparison points and then list the comments associated
>> with those changes. With this I am hoping to be able create a manifest of
>> changes.
>>
>> Any help would be appreciated.
>>
>> Andre
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...

LightInTheBox - Buy quality products at wholesale price