PageRenderTime 21ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Examples/008 - AddRemove.linq

#
Unknown | 30 lines | 25 code | 5 blank | 0 comment | 0 complexity | 1e99545a67901b8c2d43b80ad3f7e6be MD5 | raw file
 1<Query Kind="Program">
 2  <Reference Relative="..\Mercurial.Net\bin\Debug\Mercurial.NET.dll">C:\Dev\VS.NET\Mercurial.Net\Mercurial.Net\bin\Debug\Mercurial.NET.dll</Reference>
 3  <Namespace>Mercurial</Namespace>
 4</Query>
 5
 6// *****************************************************
 7// *
 8// * AddRemove example.
 9// *
10// ***********************
11
12void Main()
13{
14	var repoPath = @"C:\Temp\repo";
15    if (Directory.Exists(repoPath))
16        Directory.Delete(repoPath, true);
17    Directory.CreateDirectory(repoPath);
18    var repo = new Repository(repoPath);
19    repo.Init();
20    
21    File.WriteAllText(Path.Combine(repo.Path, "test1.txt"), "test1.txt contents");
22    File.WriteAllText(Path.Combine(repo.Path, "test2.txt"), "test2.txt contents");
23    
24    repo.AddRemove(new AddRemoveCommand()
25        .WithIncludePattern("test1.*"));
26    
27    repo.Commit("dummy");
28    repo.Log(new LogCommand()
29        .WithIncludePathActions()).Dump();
30}