Esempio n. 1
0
        public void AddAndRemoveFile()
        {
            const string fileA = "fileA.txt";
            var          fs    = File.Create(workingDirectoryForSVNTests + "\\" + fileA, 10);

            fs.Close();

            vcc.Status(StatusLevel.Local, DetailLevel.Normal);
            var status = vcc.GetAssetStatus(fileA);

            Assert.IsTrue(status.assetPath.Compose() == fileA, "AssetPath mismatch: " + status.assetPath.Compose() + "!=" + fileA);
            Assert.IsTrue(status.fileStatus == VCFileStatus.Unversioned, "Unversioned");

            vcc.Add(new[] { fileA });
            vcc.Status(StatusLevel.Local, DetailLevel.Normal);
            status = vcc.GetAssetStatus(fileA);
            Assert.IsTrue(status.fileStatus == VCFileStatus.Added, "Added");

            vcc.Commit(new[] { fileA }, "AddFile Test 1/2");
            vcc.Status(StatusLevel.Local, DetailLevel.Normal);
            status = vcc.GetAssetStatus(fileA);
            Assert.IsTrue(status.fileStatus == VCFileStatus.Normal, "Normal");

            var basePath = vcc.GetBasePath(fileA);

            Assert.That(File.Exists(basePath), Is.True, "Base path exist: " + basePath);

            vcc.Delete(new[] { fileA }, OperationMode.Normal);
            vcc.Status(StatusLevel.Local, DetailLevel.Normal);
            status = vcc.GetAssetStatus(fileA);
            Assert.IsTrue(status.fileStatus == VCFileStatus.Deleted, "Deleted");

            vcc.Commit(new[] { fileA }, "AddFile Test 2/2");
            vcc.Status(StatusLevel.Local, DetailLevel.Normal);
            status = vcc.GetAssetStatus(fileA);
            Assert.That(status.Reflected, Is.False, "fileA is not present in repo");
            Assert.IsTrue(!File.Exists(workingDirectoryForSVNTests + "\\" + fileA), "File removed again");
        }
Esempio n. 2
0
 public bool Commit(IEnumerable <string> assets, string commitMessage = "", bool _bEmptyDepth = false)
 {
     return(HandleExceptions(() =>
     {
         FlushFiles();
         Status(assets, StatusLevel.Local);
         var beforeStatus = StoreCurrentStatus(assets);
         bool commitSuccess = vcc.Commit(assets, commitMessage, _bEmptyDepth);
         Status(assets, StatusLevel.Local);
         var afterStatus = StoreCurrentStatus(assets);;
         OnOperationCompleted(OperationType.Commit, beforeStatus, afterStatus, commitSuccess);
         return commitSuccess;
     }));
 }
Esempio n. 3
0
 public bool Commit(IEnumerable <string> assets, string commitMessage = "")
 {
     return(HandleExceptions(() =>
     {
         FlushFiles();
         Status(assets, StatusLevel.Local);
         var beforeStatus = StoreCurrentStatus(assets);
         if (!OnOperationStarting(OperationType.Commit, beforeStatus))
         {
             return false;
         }
         bool commitSuccess = vcc.Commit(assets, commitMessage);
         Status(assets, StatusLevel.Local);
         var afterStatus = StoreCurrentStatus(assets);
         OnOperationCompleted(OperationType.Commit, beforeStatus, afterStatus, commitSuccess);
         return commitSuccess;
     }));
 }
Esempio n. 4
0
 public virtual bool Commit(IEnumerable <string> assets, string commitMessage = "", bool _bEmptyDepth = false)
 {
     return(vcc.Commit(assets, commitMessage, _bEmptyDepth));
 }
 public virtual bool Commit(IEnumerable <string> assets, string commitMessage = "")
 {
     return(vcc.Commit(assets, commitMessage));
 }