tags:

views:

143

answers:

1

I'm using SharpSvn to get the log for a repository. For each log entry I can access useful info about the files that have changed (via SvnLogEventArgs.ChangedPaths), but I can't figure out how to get the svn:mergeinfo property.

Any ideas? Thanks

+3  A: 

It is just a regular Subversion property. You can extract the value using the following bit of code:

string mergeInfo;
var client = new SvnClient();
bool success = client.GetProperty(
                        SvnTarget.FromString(fileName), 
                        "svn:mergeinfo", 
                        out mergeInfo);

Note that the result of GetProperty does not indicate whether or not a mergeinfo property was available but rather if the method call was a success. The mergeInfo string variable may be null even if success is true.

HakonB
Thanks, I was thinking that I could get that info directly from the log entries. Your solution works fine, except that the property is called "svn:mergeinfo" - it took me a while to spot the capitalisation!
Akash
Sorry about that :-) I just fixed it for future reference.
HakonB
You can just pass fileName as there is an implicit conversion from System.String to SvnTarget (creating a SvnPathTarget). There is also an automatic conversion from System.Uri to SvnTarget (creating a SvnUriTarget).
Bert Huijben
Ah cool. I always taken the long road and used the factory method
HakonB