public static void InitSVNClient(string path) { svnPath = path; client = new SvnClient(); SvnRemoteSession remoteSession = new SvnRemoteSession(new Uri(svnPath)); remoteSession.GetLatestRevision(out latestRevision); }
public void Remote_OpenRepos() { SvnSandBox sbox = new SvnSandBox(this); Uri CollabReposUri = sbox.CreateRepository(SandBoxRepository.MergeScenario); using (SvnRemoteSession r = new SvnRemoteSession(CollabReposUri)) { r.Reparent(CollabReposUri); long rev; Uri uri; Guid id; SvnRemoteStatEventArgs stat; long foundRev; r.GetLatestRevision(out rev); r.GetRepositoryRoot(out uri); r.GetRepositoryId(out id); r.GetStat(null, out stat); r.ResolveRevision(DateTime.Now, out foundRev); Assert.That(uri, Is.EqualTo(CollabReposUri)); Assert.That(rev, Is.EqualTo(17L)); Assert.That(id, Is.EqualTo(new Guid("d4e3f7eb-7f47-4c2b-9c6e-ba21fc616240"))); Assert.That(stat, Is.Not.Null); Assert.That(stat.Entry, Is.Not.Null); Assert.That(stat.Entry.Author, Is.EqualTo("merger")); Assert.That(stat.Entry.NodeKind, Is.EqualTo(SvnNodeKind.Directory)); int n = 0; r.List("", delegate(object sender, SvnRemoteListEventArgs e) { Assert.That(e.Name, Is.Not.Null); n++; }); Assert.That(n, Is.EqualTo(3)); Assert.That(r.SessionUri, Is.Not.Null); Assert.That(r.IsDisposed, Is.False); } }