コード例 #1
0
        public void Init()
        {
            _currentPath = Directory.GetCurrentDirectory();
            _testRepoPath = Path.Combine(_currentPath, "testRepo");
            if (Directory.Exists(_testRepoPath))
            {
                Directory.Delete(_testRepoPath, true);
            }

            Directory.CreateDirectory(_testRepoPath);

            var os = Environment.OSVersion.VersionString.ToLower();
            var hgPath = (os.Contains("win")) ? "hg" : (TestsUtils.IsRunningOnMac()) ? "/usr/local/bin/hg" : "/usr/bin/hg";

            MercurialClient.Init(_testRepoPath, hgPath);

            _mc = new MercurialClient(_testRepoPath, hgPath);

            _testFilePath = Path.Combine(_testRepoPath, "qwe.txt");
            File.AppendAllText(_testFilePath, _testFileContent);

            _mc.Add(new string[] { _testFilePath });
            _mc.Commit("first commit");
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            var currentPath = Directory.GetCurrentDirectory();
            var testRepoPath = Path.Combine(currentPath, "testRepo");
            if (Directory.Exists(testRepoPath))
            {
                Directory.Delete(testRepoPath, true);
            }

            Directory.CreateDirectory(testRepoPath);

            var os = Environment.OSVersion.VersionString.ToLower();
            var hgPath = (os.Contains("win")) ? "hg" : (IsRunningOnMac()) ? "/usr/local/bin/hg" : "/usr/bin/hg";

            MercurialClient.Init(testRepoPath, hgPath);

            var mc = new MercurialClient(testRepoPath, hgPath);

            var testFilePath = Path.Combine(testRepoPath, "qwe.txt");
            File.AppendAllText(testFilePath, "qweqwe");

            mc.Add(new string[] { testFilePath });
            mc.Commit("first commit");
        }
コード例 #3
0
 public MercurialRepository(string rootPath)
 {
     this.RootPath = rootPath;
     _mercurialClient = new MercurialClient(rootPath, "/usr/local/bin/hg");
 }
コード例 #4
0
 public MercurialRepository(string rootPath)
 {
     this.RootPath    = rootPath;
     _mercurialClient = new MercurialClient(rootPath, "/usr/local/bin/hg");
 }