Example #1
0
        public void Apply(ITfsWorkspaceModifier workspace)
        {
            workspace.Edit(Path);
            var workspaceFile = workspace.GetLocalPath(Path);

            _repository.CopyBlob(NewSha, workspaceFile);
        }
Example #2
0
        public void Apply(ITfsWorkspaceModifier workspace)
        {
            var workspaceFile = workspace.GetLocalPath(Path);

            Repository.CopyBlob(NewSha, workspaceFile);
            workspace.Add(Path);
        }
Example #3
0
 public void Apply(ITfsWorkspaceModifier workspace)
 {
     workspace.Edit(Path);
     workspace.Rename(Path, PathTo, Score);
     var workspaceFile = workspace.GetLocalPath(PathTo);
     _repository.CopyBlob(NewSha, workspaceFile);
 }
Example #4
0
 private void PendChangesToWorkspace(string head, string parent, ITfsWorkspaceModifier workspace)
 {
     using (var tidyWorkspace = new DirectoryTidier(workspace, GetLatestChangeset().GetFullTree()))
     {
         foreach (var change in Repository.GetChangedFiles(parent, head))
         {
             change.Apply(tidyWorkspace);
         }
     }
 }
 public DirectoryTidierTests()
 {
     mocks = new MockRepository();
     mockWorkspace = mocks.StrictMock<ITfsWorkspaceModifier>();
     initialTfsTree = new TfsTreeEntry [] {
         item(TfsItemType.Folder, "topDir"),
         item(TfsItemType.File,   "topDir/topFile.txt"),
         item(TfsItemType.Folder, "topDir/midDir"),
         item(TfsItemType.File,   "topDir/midDir/midFile.txt"),
         item(TfsItemType.Folder, "topDir/midDir/bottomDir"),
         item(TfsItemType.File,   "topDir/midDir/bottomDir/file1.txt"),
         item(TfsItemType.File,   "topDir/midDir/bottomDir/file2.txt"),
         item(TfsItemType.Folder, "dir1"),
         item(TfsItemType.Folder, "dir1/dir2"),
         item(TfsItemType.Folder, "dir1/dir2/dir3"),
         item(TfsItemType.File,   "dir1/dir2/dir3/lonelyFile.txt"),
         item(TfsItemType.File,   "rootFile.txt"),
     };
 }
 public DirectoryTidierTests()
 {
     mocks          = new MockRepository();
     mockWorkspace  = mocks.StrictMock <ITfsWorkspaceModifier>();
     initialTfsTree = new TfsTreeEntry[] {
         item(TfsItemType.Folder, "topDir"),
         item(TfsItemType.File, "topDir/topFile.txt"),
         item(TfsItemType.Folder, "topDir/midDir"),
         item(TfsItemType.File, "topDir/midDir/midFile.txt"),
         item(TfsItemType.Folder, "topDir/midDir/bottomDir"),
         item(TfsItemType.File, "topDir/midDir/bottomDir/file1.txt"),
         item(TfsItemType.File, "topDir/midDir/bottomDir/file2.txt"),
         item(TfsItemType.Folder, "dirA"),
         item(TfsItemType.Folder, "dirA/dirB"),
         item(TfsItemType.File, "dirA/dirB/file.txt"),
         item(TfsItemType.File, "dirA/file.txt"),
         item(TfsItemType.Folder, "dir1"),
         item(TfsItemType.Folder, "dir1/dir2"),
         item(TfsItemType.Folder, "dir1/dir2/dir3"),
         item(TfsItemType.File, "dir1/dir2/dir3/lonelyFile.txt"),
         item(TfsItemType.File, "rootFile.txt"),
     };
 }
Example #7
0
 private void PendChangesToWorkspace(string head, string parent, ITfsWorkspaceModifier workspace)
 {
     using (var tidyWorkspace = new DirectoryTidier(workspace, GetLatestChangeset().GetFullTree()))
     {
         foreach (var change in Repository.GetChangedFiles(parent, head))
         {
             change.Apply(tidyWorkspace);
         }
     }
 }
Example #8
0
 public void Apply(ITfsWorkspaceModifier workspace)
 {
     workspace.Delete(Path);
 }
Example #9
0
 public void Apply(ITfsWorkspaceModifier workspace)
 {
     var workspaceFile = workspace.GetLocalPath(Path);
     Repository.CopyBlob(NewSha, workspaceFile);
     workspace.Add(Path);
 }
Example #10
0
 public DirectoryTidier(ITfsWorkspaceModifier workspace, Func <IEnumerable <TfsTreeEntry> > getInitialTfsTree)
 {
     _workspace         = workspace;
     _getInitialTfsTree = getInitialTfsTree;
     _fileOperations    = new Dictionary <string, FileOperation>(StringComparer.InvariantCultureIgnoreCase);
 }
Example #11
0
 public DirectoryTidier(ITfsWorkspaceModifier workspace, IEnumerable <TfsTreeEntry> initialTfsTree)
 {
     _workspace           = workspace;
     _filesInTfs          = initialTfsTree.Where(entry => entry.Item.ItemType == TfsItemType.File).Select(entry => entry.FullName.ToLowerInvariant()).ToList();
     _filesRemovedFromTfs = new List <string>();
 }
Example #12
0
 public DirectoryTidier(ITfsWorkspaceModifier workspace, Func<IEnumerable<TfsTreeEntry>> getInitialTfsTree)
 {
     _workspace = workspace;
     _getInitialTfsTree = getInitialTfsTree;
     _fileOperations = new Dictionary<string, FileOperation>(StringComparer.InvariantCultureIgnoreCase);
 }
Example #13
0
 public DirectoryTidier(ITfsWorkspaceModifier workspace, IEnumerable<TfsTreeEntry> initialTfsTree)
 {
     _workspace = workspace;
     _filesInTfs = initialTfsTree.Where(entry => entry.Item.ItemType == TfsItemType.File).Select(entry => entry.FullName.ToLowerInvariant()).ToList();
     _filesRemovedFromTfs = new List<string>();
 }
Example #14
0
 public void Apply(ITfsWorkspaceModifier workspace)
 {
     workspace.Delete(Path);
 }