Beispiel #1
0
        public void Import()
        {
            string repositoryPath = Path.Combine(TestHelper.ParentPath, "SvnClientTest.Import");
            TestHelper.CreateRepository(repositoryPath, true);

            string workingPath = Path.Combine(TestHelper.WorkingPath, "Import.Test");
            PathHelper.CreateDirectory(workingPath);

            string testFile = Path.Combine(workingPath, "Readme.txt");
            File.WriteAllText(testFile, "This is a read me text file.");

            Uri repo = new Uri(repositoryPath);

            using (var client = new SvnClient(SvnClient.Commands.Import))
            {
                client.RepositoryPath = repo.ToString();
                client.LocalPath = workingPath;
                client.Message = "First Import";

                var result = client.Execute();

                Assert.IsTrue(result);

                Console.WriteLine(client.StandardOutput);
                Console.WriteLine(client.StandardError);
            }
        }
Beispiel #2
0
        public void Checkout()
        {
            string workingPath = Path.Combine(TestHelper.WorkingPath, "Checkout.Test");            
            PathHelper.DeleteDirectory(workingPath);
            
            using(var client = new SvnClient(SvnClient.Commands.Checkout))
            {
                client.RepositoryPath = TestHelper.TestRepositoryUri.ToString();
                client.LocalPath = workingPath;
                
                var result = client.Execute();

                Assert.IsTrue(result);

                Console.WriteLine(client.StandardOutput);
                Console.WriteLine(client.StandardError);
            }
        }
Beispiel #3
0
        public static bool CreateAndImport(string repositoryPath)
        {
            CreateRepository(repositoryPath, true);

            string workingPath = Path.Combine(WorkingPath, "Create.Readme");
            PathHelper.CreateDirectory(workingPath);

            string testFile = Path.Combine(workingPath, "Readme.txt");
            File.WriteAllText(testFile, "This is a read me text file." + Environment.NewLine);

            Uri repo = new Uri(repositoryPath);

            using (var client = new SvnClient(SvnClient.Commands.Import))
            {
                client.RepositoryPath = repo.ToString();
                client.LocalPath = workingPath;
                client.Message = "First Import";

                var r = client.Execute();
                Console.WriteLine(client.StandardOutput);
                Console.WriteLine(client.StandardError);
                return r;
            }
        }
Beispiel #4
0
        public static bool CreateWorking(string repositoryPath, string workingPath)
        {
            PathHelper.DeleteDirectory(workingPath);
            Uri repo = new Uri(repositoryPath);

            using (var client = new SvnClient(SvnClient.Commands.Checkout))
            {
                client.RepositoryPath = repo.ToString();
                client.LocalPath = workingPath;
                
                var r = client.Execute();
                Console.WriteLine(client.StandardOutput);
                Console.WriteLine(client.StandardError);
                return r;
            }
        }
Beispiel #5
0
        public static bool CommitWorking(string workingPath)
        {
            using (var client = new SvnClient(SvnClient.Commands.Commit))
            {
                client.LocalPath = workingPath;
                client.Message = "Commit progress";

                var r = client.Execute();
                Console.WriteLine(client.StandardOutput);
                Console.WriteLine(client.StandardError);
                return r;
            }
        }