views:

25

answers:

1

Hello, I have been working with SharpSVN quite a bit lately and I'm currently trying to obtain all of a revisions children's revision numbers. I see that using SvnLogEventArgs.HasChildren I can verify that they exist but it need the actual numbers of the children below it. I've been looking at the SvnClient object and see a GetMergesMerged() but an unable to determine what to feed it to return it the correct values, right now it does not return anything.

System.Collections.ObjectModel.Collection<SvnMergesMergedEventArgs> logitems = null;
SvnTarget target = SvnTarget.FromUri(new Uri(myRepoURL));
SvnUriTarget targetUri = new SvnUriTarget(new Uri(myRepoURL), revision);
client.GetMergesMerged(target, targetUri, out logitems);

This is what I currently use but is not returning anything, if someone could point me in the right direction it would be appreciated. -Thanks

A: 

To do what you want, you should use the Log (or GetLog) method.

Client.Log(new Uri(myRepoUrl),
    new SvnLogArgs
    {
        Start = startRevision,
        End = endRevision,
        Limit = numberOfItemsToFetch,
        RetrieveMergedRevisions = true
    },
    (s, e) =>
    {
        // e.MergeLogNestingLevel indicates if this is the first, second or nth level merge
    });

As with every SharpSvn call that takes a delegate, if you want to use the eventargs outside of the delegate, be sure to call e.Detach() inside the delegate/lambda

Sander Rijken
Okay I think I see, I actually currently use the RetrieveMergedRevisions so I'm not sure why I didn't see this before, I've actually had all the information to determine the NestingLevel but was trying to do it on a Revision->Revision basis and not looking at the big picture. Thanks.
Sam F
`GetMergesMerged` is to check what revisions have been merged between source and target, so it will only contain the merged revisions, not the normal ones
Sander Rijken
I see, I was confused on why there were multiple Targets one being source and the other being target, that makes a lot more sense now, The API documentation doesn't explain much so I often have to test through and try and infer what each class method is doing. Thanks for the explanation.
Sam F