Monday, August 16, 2010

Browsing Subversion with SharpSvn

Using SharpSvn to browse a Subversion repository:
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using SharpSvn;

public IEnumerable<string> GetSubBranches(string baseUrl)
{
SvnClient client = new SvnClient();
SvnTarget target = new SvnUriTarget(baseUrl);
var list = new Collection();
client.GetList(target, out list);
return list.
Where(l => !string.IsNullOrEmpty(l.Path)).
Select(l => l.Path);
}

No comments: