/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
- <Query Kind="Program">
- <Reference Relative="..\Mercurial.Net\bin\Debug\Mercurial.NET.dll">C:\Dev\VS.NET\Mercurial.Net\Mercurial.Net\bin\Debug\Mercurial.NET.dll</Reference>
- <Namespace>Mercurial</Namespace>
- </Query>
-
- // *****************************************************
- // *
- // * AddRemove example.
- // *
- // ***********************
-
- void Main()
- {
- var repoPath = @"C:\Temp\repo";
- if (Directory.Exists(repoPath))
- Directory.Delete(repoPath, true);
- Directory.CreateDirectory(repoPath);
- var repo = new Repository(repoPath);
- repo.Init();
-
- File.WriteAllText(Path.Combine(repo.Path, "test1.txt"), "test1.txt contents");
- File.WriteAllText(Path.Combine(repo.Path, "test2.txt"), "test2.txt contents");
-
- repo.AddRemove(new AddRemoveCommand()
- .WithIncludePattern("test1.*"));
-
- repo.Commit("dummy");
- repo.Log(new LogCommand()
- .WithIncludePathActions()).Dump();
- }