Represents the name of a VSS item.
Example #1
0
 public Revision(DateTime dateTime, string user, VssItemName item,
     int version, string comment, VssAction action)
 {
     this.dateTime = dateTime;
     this.user = user;
     this.item = item;
     this.version = version;
     this.comment = comment;
     this.action = action;
 }
Example #2
0
 public VssProjectInfo MoveProjectTo(VssItemName project, VssItemName subproject, string newProjectSpec)
 {
     var subprojectInfo = GetOrCreateProject(subproject);
     var lastSlash = newProjectSpec.LastIndexOf('/');
     if (lastSlash > 0)
     {
         var newParentSpec = newProjectSpec.Substring(0, lastSlash);
         var parentInfo = ResolveProjectSpec(newParentSpec);
         if (parentInfo != null)
         {
             // propagate the destroyed flag from the new parent
             subprojectInfo.Parent = parentInfo;
             subprojectInfo.Destroyed |= parentInfo.Destroyed;
         }
         else
         {
             // if resolution fails, the target project has been destroyed
             // or is outside the set of projects being mapped
             subprojectInfo.Destroyed = true;
         }
     }
     return subprojectInfo;
 }
Example #3
0
        public VssItemInfo BranchFile(VssItemName project, VssItemName newName, VssItemName oldName)
        {
            Debug.Assert(!newName.IsProject);
            Debug.Assert(!oldName.IsProject);

            // "branching a file" (in VSS parlance) essentially moves it from
            // one project to another (and could potentially change its name)
            var parentInfo = GetOrCreateProject(project);

            // remove filename from old project
            var oldFile = GetOrCreateFile(oldName);
            oldFile.RemoveProject(parentInfo);
            parentInfo.RemoveItem(oldFile);

            // add filename to new project
            var newFile = GetOrCreateFile(newName);
            newFile.AddProject(parentInfo);
            parentInfo.AddItem(newFile);

            // retain version number from old file
            newFile.Version = oldFile.Version;

            return newFile;
        }
Example #4
0
 public VssItemInfo PinItem(VssItemName project, VssItemName name)
 {
     // pinning removes the project from the list of
     // sharing projects, so it no longer receives edits
     return DeleteItem(project, name);
 }
Example #5
0
 public VssItemInfo DeleteItem(VssItemName project, VssItemName name)
 {
     var parentInfo = GetOrCreateProject(project);
     VssItemInfo itemInfo;
     if (name.IsProject)
     {
         var projectInfo = GetOrCreateProject(name);
         projectInfo.Parent = null;
         itemInfo = projectInfo;
     }
     else
     {
         var fileInfo = GetOrCreateFile(name);
         fileInfo.RemoveProject(parentInfo);
         parentInfo.RemoveItem(fileInfo);
         itemInfo = fileInfo;
     }
     return itemInfo;
 }
Example #6
0
 public VssRestoreAction(VssItemName name, string archivePath)
     : base(name)
 {
     this.ArchivePath = archivePath;
 }
Example #7
0
 public VssMoveToAction(VssItemName name, string newProject)
     : base(name)
 {
     this.NewProject = newProject;
 }
Example #8
0
 public VssAddAction(VssItemName name)
     : base(name)
 {
 }
Example #9
0
 public VssMoveToAction(VssItemName name, string newProject)
     : base(name)
 {
     this.newProject = newProject;
 }
Example #10
0
 public VssDestroyAction(VssItemName name)
     : base(name)
 {
 }
Example #11
0
 public VssDeleteAction(VssItemName name)
     : base(name)
 {
 }
Example #12
0
 public VssCreateAction(VssItemName name)
     : base(name)
 {
 }
Example #13
0
 public VssBranchAction(VssItemName name, VssItemName source)
     : base(name)
 {
     this.source = source;
 }
Example #14
0
        public VssItemInfo BranchFile(VssItemName project, VssItemName newName, VssItemName oldName)
        {
            Debug.Assert(!newName.IsProject);
            Debug.Assert(!oldName.IsProject);

            var parentInfo = GetOrCreateProject(project);
            var oldFile = GetOrCreateFile(oldName);
            oldFile.RemoveProject(parentInfo);
            var newFile = GetOrCreateFile(newName);
            newFile.AddProject(parentInfo);
            newFile.Version = oldFile.Version;
            return newFile;
        }
Example #15
0
 private VssProjectInfo GetOrCreateProject(VssItemName name)
 {
     VssProjectInfo projectInfo;
     if (!projectInfos.TryGetValue(name.PhysicalName, out projectInfo))
     {
         projectInfo = new VssProjectInfo(name.PhysicalName, name.LogicalName);
         projectInfos[name.PhysicalName] = projectInfo;
     }
     return projectInfo;
 }
Example #16
0
 public VssNamedAction(VssItemName name)
 {
     this.name = name;
 }
Example #17
0
 public VssDestroyAction(VssItemName name)
     : base(name)
 {
 }
Example #18
0
 public VssPinAction(VssItemName name, bool pinned, int revision)
     : base(name)
 {
     this.pinned = pinned;
     this.revision = revision;
 }
Example #19
0
 public VssRecoverAction(VssItemName name)
     : base(name)
 {
 }
Example #20
0
 public VssRecoverAction(VssItemName name)
     : base(name)
 {
 }
Example #21
0
 public VssPinAction(VssItemName name, bool pinned, int revision)
     : base(name)
 {
     this.Pinned   = pinned;
     this.Revision = revision;
 }
Example #22
0
 public VssRenameAction(VssItemName name, string originalName)
     : base(name)
 {
     this.originalName = originalName;
 }
Example #23
0
 internal VssItem(VssDatabase database, VssItemName itemName, string physicalPath)
 {
     this.database     = database;
     this.itemName     = itemName;
     this.physicalPath = physicalPath;
 }
Example #24
0
 public VssRestoreAction(VssItemName name, string archivePath)
     : base(name)
 {
     this.archivePath = archivePath;
 }
Example #25
0
 public VssItemInfo RecoverItem(VssItemName project, VssItemName name)
 {
     var parentInfo = GetOrCreateProject(project);
     VssItemInfo itemInfo;
     if (name.IsProject)
     {
         var projectInfo = GetOrCreateProject(name);
         projectInfo.Parent = parentInfo;
         itemInfo = projectInfo;
     }
     else
     {
         var fileInfo = GetOrCreateFile(name);
         fileInfo.AddProject(parentInfo);
         parentInfo.AddItem(fileInfo);
         itemInfo = fileInfo;
     }
     return itemInfo;
 }
Example #26
0
 public VssShareAction(VssItemName name, string originalProject)
     : base(name)
 {
     this.originalProject = originalProject;
 }
Example #27
0
 public VssItemInfo UnpinItem(VssItemName project, VssItemName name)
 {
     // unpinning restores the project to the list of
     // sharing projects, so it receives edits
     return RecoverItem(project, name);
 }
Example #28
0
 public VssAddAction(VssItemName name)
     : base(name)
 {
 }
Example #29
0
        public VssProjectInfo MoveProjectFrom(VssItemName project, VssItemName subproject, string oldProjectSpec)
        {
            Debug.Assert(subproject.IsProject);

            var parentInfo = GetOrCreateProject(project);
            var subprojectInfo = GetOrCreateProject(subproject);
            subprojectInfo.Parent = parentInfo;
            return subprojectInfo;
        }
Example #30
0
 internal VssFile(VssDatabase database, VssItemName itemName, string physicalPath)
     : base(database, itemName, physicalPath)
 {
 }
Example #31
0
 public bool ProjectContainsLogicalName(VssItemName project, VssItemName name)
 {
     var parentInfo = GetOrCreateProject(project);
     return parentInfo.ContainsLogicalName(name.LogicalName);
 }
Example #32
0
 internal VssProject(VssDatabase database, VssItemName itemName,
                     string physicalPath, string logicalPath)
     : base(database, itemName, physicalPath)
 {
     this.logicalPath = logicalPath;
 }
Example #33
0
 private VssFileInfo GetOrCreateFile(VssItemName name)
 {
     VssFileInfo fileInfo;
     if (!fileInfos.TryGetValue(name.PhysicalName, out fileInfo))
     {
         fileInfo = new VssFileInfo(name.PhysicalName, name.LogicalName);
         fileInfos[name.PhysicalName] = fileInfo;
     }
     return fileInfo;
 }
Example #34
0
 public VssProjectInfo MoveProjectTo(VssItemName project, VssItemName subproject, string newProjectSpec)
 {
     var subprojectInfo = GetOrCreateProject(subproject);
     var lastSlash = newProjectSpec.LastIndexOf('/');
     if (lastSlash > 0)
     {
         var newParentSpec = newProjectSpec.Substring(0, lastSlash);
         var parentInfo = ResolveProjectSpec(newParentSpec);
         if (parentInfo != null)
         {
             // propagate the destroyed flag from the new parent
             subprojectInfo.Destroyed |= parentInfo.Destroyed;
             if (subprojectInfo.Destroyed)
             {
                 // otherwise the parent will be updated in MoveProjectFrom
                 subprojectInfo.Parent = parentInfo;
             }
         }
         else if (IsInMappedSet(newParentSpec))
         {
             // if resolution fails, the target project has been destroyed
             subprojectInfo.Destroyed = true;
         }
     }
     return subprojectInfo;
 }
Example #35
0
 public VssCreateAction(VssItemName name)
     : base(name)
 {
 }
Example #36
0
 public string TryToGetPhysicalNameContainedInProject(VssItemName project, VssItemName name)
 {
     var parentInfo = GetOrCreateProject(project);
     return parentInfo.TryToGetPhysicalName(name.LogicalName);
 }
Example #37
0
 public VssDeleteAction(VssItemName name)
     : base(name)
 {
 }
Example #38
0
 internal VssFile(VssDatabase database, VssItemName itemName, string physicalPath)
     : base(database, itemName, physicalPath)
 {
 }
Example #39
0
 public VssRenameAction(VssItemName name, string originalName)
     : base(name)
 {
     this.OriginalName = originalName;
 }
Example #40
0
 public void SetFileVersion(VssItemName name, int version)
 {
     VssFileInfo fileInfo = GetOrCreateFile(name);
     fileInfo.Version = version;
 }
Example #41
0
 public VssShareAction(VssItemName name, string originalProject)
     : base(name)
 {
     this.OriginalProject = originalProject;
 }
Example #42
0
        public VssItemInfo AddItem(VssItemName project, VssItemName name)
        {
            var parentInfo = GetOrCreateProject(project);
            VssItemInfo itemInfo;
            if (name.IsProject)
            {
                var projectInfo = GetOrCreateProject(name);
                projectInfo.Parent = parentInfo;
                itemInfo = projectInfo;
            }
            else
            {
                var fileInfo = GetOrCreateFile(name);
                fileInfo.AddProject(parentInfo);
                parentInfo.AddItem(fileInfo);
                itemInfo = fileInfo;
            }

            // update name of item in case it was created on demand by
            // an earlier unmapped item that was subsequently renamed
            itemInfo.LogicalName = name.LogicalName;

            return itemInfo;
        }
Example #43
0
 public VssBranchAction(VssItemName name, VssItemName source)
     : base(name)
 {
     this.Source = source;
 }
Example #44
0
 public VssItemInfo RenameItem(VssItemName name)
 {
     VssItemInfo itemInfo;
     if (name.IsProject)
     {
         itemInfo = GetOrCreateProject(name);
     }
     else
     {
         itemInfo = GetOrCreateFile(name);
     }
     itemInfo.LogicalName = name.LogicalName;
     return itemInfo;
 }
Example #45
0
 public VssNamedAction(VssItemName name)
 {
     this.name = name;
 }
Example #46
0
 public VssMoveFromAction(VssItemName name, string originalProject)
     : base(name)
 {
     this.originalProject = originalProject;
 }