Example #1
0
        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);
            }
        }
Example #2
0
        public void Remote_StatFile()
        {
            using (SvnRemoteSession rc = new SvnRemoteSession())
            {
                rc.Open(new Uri("http://svn.apache.org/repos/asf/subversion/trunk/COMMITTERS"));

                SvnRemoteStatEventArgs st;
                rc.GetStat("", out st);

                Assert.That(st, Is.Not.Null);
                Assert.That(st.Entry.Time, Is.GreaterThan(new DateTime(2006, 1, 1)));

                SvnNodeKind kind;
                rc.GetNodeKind("", out kind);
                Assert.That(kind, Is.EqualTo(SvnNodeKind.File));

                rc.GetNodeKind("QQQ", out kind);

                Assert.That(kind, Is.EqualTo(SvnNodeKind.None));
            }
        }