public void Remote_LocationSegments() { SvnSandBox sbox = new SvnSandBox(this); SvnRemoteSession rs; using (SvnRemoteSession rc = new SvnRemoteSession()) { Uri root = sbox.CreateRepository(SandBoxRepository.MergeScenario); rc.Open(root); int n = 0; rc.LocationSegments("branches/b/about/index.html", delegate(object sender, SvnRemoteLocationSegmentEventArgs e) { switch (n++) { case 0: Assert.That(e.RepositoryPath, Is.EqualTo("branches/b/about/index.html")); Assert.That(e.Uri, Is.EqualTo(new Uri(root, e.RepositoryPath))); break; case 1: Assert.That(e.RepositoryPath, Is.EqualTo("trunk/about/index.html")); break; default: Assert.That(false); break; } }); Assert.That(n, Is.EqualTo(2)); rs = rc; long r; Assert.That(rc.GetDeletedRevision("trunk", 2, out r)); Assert.That(r, Is.EqualTo(-1)); } Assert.That(!rs.IsCommandRunning); Assert.That(rs.IsDisposed); }
public void Remote_LogRanges() { SvnSandBox sbox = new SvnSandBox(this); Uri CollabReposUri = sbox.CreateRepository(SandBoxRepository.MergeScenario); using (SvnRemoteSession rc = new SvnRemoteSession()) using (SvnRemoteSession rc2 = new SvnRemoteSession()) { Uri reposRoot; rc.Open(CollabReposUri); rc.GetRepositoryRoot(out reposRoot); rc2.Open(reposRoot); rc.LocationSegments("branches/c/products/medium.html", delegate(object sender, SvnRemoteLocationSegmentEventArgs e) { rc2.Log(rc2.MakeRelativePath(e.Uri), e.Range.Reverse(), delegate(object sender2, SvnRemoteLogEventArgs e2) { Debug.WriteLine(string.Format("{0} in {1} as {2} ({3}): {4}", e2.Author, e2.Revision, e.RepositoryPath, e.Range, e2.LogMessage)); }); }); } }