public void Dump_DumpDb() { SvnSandBox sbox = new SvnSandBox(this); string repos = sbox.GetTempDir(); using (SvnRepositoryClient cl = new SvnRepositoryClient()) { SvnCreateRepositoryArgs ra = new SvnCreateRepositoryArgs(); ra.RepositoryType = SvnRepositoryFileSystem.BerkeleyDB; ra.RepositoryCompatibility = SvnRepositoryCompatibility.Subversion10; cl.CreateRepository(repos, ra); string file = GetTempFile(); using (FileStream s = File.Create(file)) { SvnDumpRepositoryArgs da = new SvnDumpRepositoryArgs(); da.Start = new SvnRevision(0); da.End = new SvnRevision(SvnRevisionType.Head); cl.DumpRepository(repos, s, da); } Assert.That(new FileInfo(file).Length, Is.GreaterThan(12)); } }
public void Dump_DumpDb() { SvnSandBox sbox = new SvnSandBox(this); string repos = sbox.GetTempDir(); using (SvnRepositoryClient cl = new SvnRepositoryClient()) { SvnCreateRepositoryArgs ra = new SvnCreateRepositoryArgs(); ra.RepositoryType = SvnRepositoryFileSystem.BerkeleyDB; ra.RepositoryCompatibility = SvnRepositoryCompatibility.Subversion10; cl.CreateRepository(repos, ra); string file = GetTempFile(); using(FileStream s = File.Create(file)) { SvnDumpRepositoryArgs da = new SvnDumpRepositoryArgs(); da.Start = new SvnRevision(0); da.End = new SvnRevision(SvnRevisionType.Head); cl.DumpRepository(repos, s, da); } Assert.That(new FileInfo(file).Length, Is.GreaterThan(12)); } }
public void CreateRepository_FsFs() { SvnSandBox sbox = new SvnSandBox(this); using (SvnRepositoryClient reposClient = new SvnRepositoryClient()) { SvnCreateRepositoryArgs cra = new SvnCreateRepositoryArgs(); cra.RepositoryCompatibility = SvnRepositoryCompatibility.Default; reposClient.CreateRepository(sbox.GetTempDir(), cra); } }
public void CreateRepository_Bdb() { SvnSandBox sbox = new SvnSandBox(this); using (SvnRepositoryClient reposClient = new SvnRepositoryClient()) { SvnCreateRepositoryArgs cra = new SvnCreateRepositoryArgs(); cra.RepositoryType = SvnRepositoryFileSystem.BerkeleyDB; cra.RepositoryCompatibility = SvnRepositoryCompatibility.Default; reposClient.CreateRepository(sbox.GetTempDir(), cra); } }
public void CreateBdbRepos() { SvnSandBox sbox = new SvnSandBox(this); string path = sbox.GetTempDir(); SvnRepositoryClient reposClient = new SvnRepositoryClient(); SvnCreateRepositoryArgs ra = new SvnCreateRepositoryArgs(); ra.RepositoryType = SvnRepositoryFileSystem.BerkeleyDB; reposClient.CreateRepository(path, ra); Assert.That(File.Exists(Path.Combine(path, "db/DB_CONFIG"))); reposClient.HotCopy(path, sbox.GetTempDir()); reposClient.SetRevisionProperty(path, 0, SvnPropertyNames.SvnLog, "Hahaha"); }
public Uri CreateRepository(SandBoxRepository type) { string dir = GetTempDir("repos"); using (SvnRepositoryClient rc = new SvnRepositoryClient()) { rc.UseDefaultConfiguration(); // Don't load config SvnCreateRepositoryArgs cra = new SvnCreateRepositoryArgs(); if (type == SandBoxRepository.EmptyNoMerge) { cra.RepositoryCompatibility = SvnRepositoryCompatibility.Subversion14; } rc.CreateRepository(dir, cra); Uri uri = SvnTools.LocalPathToUri(dir, false); switch (type) { case SandBoxRepository.Empty: break; case SandBoxRepository.Default: case SandBoxRepository.DefaultBranched: SvnRepositoryOperationArgs ra = new SvnRepositoryOperationArgs(); ra.LogMessage = "r1"; using (SvnMultiCommandClient mucc = new SvnMultiCommandClient(uri, ra)) { mucc.CreateDirectory("trunk"); mucc.CreateDirectory("trunk/src"); mucc.CreateDirectory("branches"); mucc.CreateDirectory("branches/A"); mucc.CreateDirectory("branches/B"); mucc.CreateFile("trunk/README.txt", new MemoryStream(Encoding.UTF8.GetBytes("Read me, please?\n"))); mucc.CreateFile("trunk/src/file1.cs", new MemoryStream(Encoding.UTF8.GetBytes("using SharpSvn;\n"))); mucc.CreateFile("trunk/src/file2.vb", new MemoryStream(Encoding.UTF8.GetBytes("Imports SharpSvn;\n"))); mucc.CreateFile("trunk/src/file3.cpp", new MemoryStream(Encoding.UTF8.GetBytes("using namespace SharpSvn;\n"))); mucc.SetProperty("trunk/src/file3.cpp", SvnPropertyNames.SvnEolStyle, "native"); mucc.CreateFile("trunk/src/file4.fs", new MemoryStream(Encoding.UTF8.GetBytes("namespace SharpSvn\n"))); mucc.SetProperty("trunk/src/file4.fs", SvnPropertyNames.SvnEolStyle, "LF"); mucc.Commit(); } if (type == SandBoxRepository.Default) { break; } ra.LogMessage = "r2"; using (SvnMultiCommandClient mucc = new SvnMultiCommandClient(uri, ra)) { mucc.CreateDirectory("branches/C"); mucc.Copy("trunk", "branches/trunk-r1"); mucc.UpdateFile("trunk/README.txt", new MemoryStream(Encoding.UTF8.GetBytes("Read me, please?\n\"Ok, read!\"\n"))); mucc.Commit(); } ra.LogMessage = "r3"; using (SvnMultiCommandClient mucc = new SvnMultiCommandClient(uri, ra)) { mucc.CreateDirectory("branches/D"); mucc.Copy("trunk", "branches/trunk-r2"); mucc.UpdateFile("trunk/README.txt", new MemoryStream(Encoding.UTF8.GetBytes("Read me, please?\n\"Ok, read!\"\n"))); mucc.Commit(); } ra.LogMessage = "r4"; using (SvnMultiCommandClient mucc = new SvnMultiCommandClient(uri, ra)) { mucc.CreateDirectory("branches/E"); mucc.Copy("trunk", "branches/trunk-r3"); mucc.UpdateFile("trunk/README.txt", new MemoryStream(Encoding.UTF8.GetBytes("Read me, please?\n\"Ok, read!\"\nNo way!\n"))); mucc.Commit(); } break; case SandBoxRepository.MergeScenario: rc.LoadRepository(dir, typeof(SvnSandBox).Assembly.GetManifestResourceStream("SharpSvn.TestBuilder.Resources.MergeScenario.repos")); break; case SandBoxRepository.AnkhSvnCases: BuildAnkhCases(uri); break; case SandBoxRepository.Greek: BuildGreek(uri); break; default: break; } } return(SvnTools.LocalPathToUri(dir, true)); }