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; }
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; }
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; }
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); }
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; }
public VssRestoreAction(VssItemName name, string archivePath) : base(name) { this.ArchivePath = archivePath; }
public VssMoveToAction(VssItemName name, string newProject) : base(name) { this.NewProject = newProject; }
public VssAddAction(VssItemName name) : base(name) { }
public VssMoveToAction(VssItemName name, string newProject) : base(name) { this.newProject = newProject; }
public VssDestroyAction(VssItemName name) : base(name) { }
public VssDeleteAction(VssItemName name) : base(name) { }
public VssCreateAction(VssItemName name) : base(name) { }
public VssBranchAction(VssItemName name, VssItemName source) : base(name) { this.source = source; }
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; }
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; }
public VssNamedAction(VssItemName name) { this.name = name; }
public VssPinAction(VssItemName name, bool pinned, int revision) : base(name) { this.pinned = pinned; this.revision = revision; }
public VssRecoverAction(VssItemName name) : base(name) { }
public VssPinAction(VssItemName name, bool pinned, int revision) : base(name) { this.Pinned = pinned; this.Revision = revision; }
public VssRenameAction(VssItemName name, string originalName) : base(name) { this.originalName = originalName; }
internal VssItem(VssDatabase database, VssItemName itemName, string physicalPath) { this.database = database; this.itemName = itemName; this.physicalPath = physicalPath; }
public VssRestoreAction(VssItemName name, string archivePath) : base(name) { this.archivePath = archivePath; }
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; }
public VssShareAction(VssItemName name, string originalProject) : base(name) { this.originalProject = originalProject; }
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); }
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; }
internal VssFile(VssDatabase database, VssItemName itemName, string physicalPath) : base(database, itemName, physicalPath) { }
public bool ProjectContainsLogicalName(VssItemName project, VssItemName name) { var parentInfo = GetOrCreateProject(project); return parentInfo.ContainsLogicalName(name.LogicalName); }
internal VssProject(VssDatabase database, VssItemName itemName, string physicalPath, string logicalPath) : base(database, itemName, physicalPath) { this.logicalPath = logicalPath; }
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; }
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; }
public string TryToGetPhysicalNameContainedInProject(VssItemName project, VssItemName name) { var parentInfo = GetOrCreateProject(project); return parentInfo.TryToGetPhysicalName(name.LogicalName); }
public VssRenameAction(VssItemName name, string originalName) : base(name) { this.OriginalName = originalName; }
public void SetFileVersion(VssItemName name, int version) { VssFileInfo fileInfo = GetOrCreateFile(name); fileInfo.Version = version; }
public VssShareAction(VssItemName name, string originalProject) : base(name) { this.OriginalProject = originalProject; }
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; }
public VssBranchAction(VssItemName name, VssItemName source) : base(name) { this.Source = source; }
public VssItemInfo RenameItem(VssItemName name) { VssItemInfo itemInfo; if (name.IsProject) { itemInfo = GetOrCreateProject(name); } else { itemInfo = GetOrCreateFile(name); } itemInfo.LogicalName = name.LogicalName; return itemInfo; }
public VssMoveFromAction(VssItemName name, string originalProject) : base(name) { this.originalProject = originalProject; }