PageRenderTime 24ms CodeModel.GetById 0ms 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
Possible License(s): BSD-3-Clause, GPL-2.0
  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. // * AddRemove example.
  8. // *
  9. // ***********************
  10. void Main()
  11. {
  12. var repoPath = @"C:\Temp\repo";
  13. if (Directory.Exists(repoPath))
  14. Directory.Delete(repoPath, true);
  15. Directory.CreateDirectory(repoPath);
  16. var repo = new Repository(repoPath);
  17. repo.Init();
  18. File.WriteAllText(Path.Combine(repo.Path, "test1.txt"), "test1.txt contents");
  19. File.WriteAllText(Path.Combine(repo.Path, "test2.txt"), "test2.txt contents");
  20. repo.AddRemove(new AddRemoveCommand()
  21. .WithIncludePattern("test1.*"));
  22. repo.Commit("dummy");
  23. repo.Log(new LogCommand()
  24. .WithIncludePathActions()).Dump();
  25. }