VersionControlServer Members
Include Protected Members
Include Inherited Members
The VersionControlServer object represents the database.
The VersionControlServer type exposes the following members.
Methods
Name
Description
Creates or updates a label. A label designates a collection of specific versions of files and folders. For example, the label Beta 1 may refer to the files server.cs, client.cs, and om.cs as they were on March 3, and the file server.cs as it was on March 5. When you applying a label, it allows you to get the versions of the files with that label. This procedure is commonly used to ensure that you can reproduce a build. Every label has a scope, and its name must be unique within that scope. Most commonly, a label is scoped by the team project. This means that within a given team project, there can be only one label called Beta 1. However, you can choose to set the scope of a label to a lower level in the folder hierarchy. If Beta 1 is scoped at $/CmdLine/shell, then there can be no other label called Beta 1 in $/CmdLine/shell or any folder below it; however, $/CmdLine/parser may use the same label.
At the top level of the Team Foundation Server folder hierarchy are the team projects: the folders immediately below $/ in the tree. All folders and files under source control are directly or indirectly below the team projects. This function creates a team project and configures the folder's settings, permissions, and check-in notes.
Overloaded. Creates a new workspace.
Deletes the label with the specified name and label scope.
Overloaded. Removes a shelveset from the server.
Deletes the workspace with the specified name and owner.
Overloaded. Downloads the latest version of a file from the server and puts its contents in a local file.
Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
When a user checks changes into the server that is running Team Foundation Server, he can leave, in addition to a generic comment string, a series of named note fields. For instance, a user might type at the command prompt /notes:reviewer=Bob;testsite=Chicago when they check in their files. Team Foundation Server does not have hard-coded fields called reviewer or testsite but they are entered as named properties of this changeset. In general, the property names are not established by the user checking in, but by company policy, so you can query later for all changesets where the testsite property was set to Chicago. This gives you the ability to extend the Team Foundation Server-provided fields associated with changesets. This method returns a list of all the check-in note field names that have ever been used in this Team Foundation Server database. So if the above example had ever been executed on any changeset, the returned list would include the strings reviewer and testsite.
At the top level of the Team Foundation Server folder hierarchy are the team projects: the folders immediately below $/ in the tree. All folders and files under source control are directly or indirectly below the team projects. This function gets a list of all the team projects on the server that is running Team Foundation Server.
Returns the branch history for the requested items.
Overloaded. Gets the details of a changeset.
When a user checks in changes into the server that is running Team Foundation Server, they can leave, in addition to a generic comment string, a series of named note fields. For instance, a user might type on the command line /notes:reviewer=Bob;testsite=Chicago when they check in their files. Team Foundation Server does not have hard-coded fields called reviewer or testsite but they are entered as named properties of this changeset. In general, the property names are not established by the user checking in files, but by company policy, so you can query later for all changesets where the testsite property was set to Chicago. This gives you the ability to extend the Team Foundation Server-provided fields associated with changesets. This method returns the field definitions for all the note fields in the specified Team Projects. A field definition shows the string (such as testsite in the above example), but also an item the definition is associated with, whether the field is required, and where the item should be displayed in the order that you choose.
GetCheckinNoteDefinitionsForServerPaths
When a user checks in changes into the server that is running Team Foundation Server server, they can leave, in addition to a generic comment string, a series of named note fields. For instance, a user might type at the command prompt /notes:reviewer=Bob;testsite=Chicago when they check-in files. Team Foundation Server does not have hard-coded fields called reviewer or testsite but they are entered as named properties of this changeset. In general, the property names are not established by the user checking in files, but by company policy, so you can query later for all changesets where the testsite property was set to Chicago. This gives you the ability to extend the Team Foundation Server-provided fields associated with changesets. This method returns the field definitions for all the note fields in the specified Team Projects. A field definition shows the string (such as testsite in the above example), but also an item the definition is associated with, whether the field is required, and where the item should be displayed in the order you choose.
GetCheckinPoliciesForServerPaths
Gets the list of check in policies for the specified team projects.
Global permissions are permissions that apply to an entire server that is running Team Foundation Server, rather than to one file or folder on that server. The global permissions govern different behaviors from item-level permissions. For instance, Checkin is an item-level permission and Administer Shelvets is a global permission. This method gets the global permissions for the specified user, taking into account both the explicitly set permissions and the permissions of any groups to which the user belongs.
Does the user have permissions set to check in that particular file? When you answer this question in Team Foundation Server, it can involve some or all the following additional questions: What rights (both allow and deny) does this user have to this file? Does this file inherit rights from its parent folder? If so, what rights does this user have to that parent folder? (and continuing up the tree) What groups does this user belong to, and what rights do they have? This method takes into account all of these answers to return a set of actual rights that the specified user has to the specified file or folder.
Overloaded. Gets a list of extended items in the database that matches the specified criteria.
The server that is running Team Foundation Server returns a list of all the file types registered. Team Foundation Server maintains a list of file types in order to control the multiple checkout option. Files that can be merged (text files) may allow multiple checkouts; files that cannot be merged (most types of binary files) generally do not. The Team Foundation Server administrator defines a list of known file types. When a new file is added to Team Foundation Server, its file extension is used to identify its file type, and thereby controls multiple checkouts.
Global permissions are permissions that apply to an entire server that is running Team Foundation Server, rather than to one file or folder on that server. The global permissions govern different behaviors from item-level permissions. For instance, Checkin is an item-level permission and Administer Shelvets is a global permission. This method gets the global permissions for the server that is running Team Foundation Server for the specified users or groups. The permissions are returned in string form for easier user display. It is not possible to parse these strings to find a user's global permissions as this depends on the user's membership to certain groups. You can use the GetEffectiveGlobalPermissions method to find the permissions that are granted to a user.
Serves as a hash function for a particular type. (Inherited from Object.)
Overloaded. Gets the Item object for the path specified.
Overloaded. Gets a list of Items in the database.
When a user adds, deletes, edits, branches or merges files, these changes are made in his workspace only. When a user checks in files, all these changes become one changeset which is automically updated on the server to be available to other users. That changeset is associated with a changeset ID which acts as a version number for every updated item.This function gets the changeset ID for the most recent changeset on the server that is running Team Foundation Server. The returned value can be passed to GetChangeset() to get all the details on that particular changeset.
Gets the merge candidates for merging between the requested items.
Overloaded. Gets a pending change from the database, based on the pending change ID.
Overloaded.
When a user adds, deletes, edits, branches or merges a file, these changes are made in their workspace only. The changes are pending until the user checks them into Team Foundation Server. This function gets all the pending changes for the passed items, but download information is not included. Without download information the function call is faster, but if you want to download files, you should use the overload method that will allow you to get download information with the returned items.This function cannot return pending changes on deleted items: that can be done with an overload version of the same function.
Overloaded. Gets the permissions for items in the database.
At the top level of the Team Foundation Server folder hierarchy are the team projects; the folders immediately below $/ in the tree. All folders and files under source control are directly or indirectly below the team projects. This function gets a specified team project.
At the top level of the Team Foundation Server folder hierarchy are the team projects; the folders immediately below $/ in the tree. All folders and files under source control are directly or indirectly below the team projects. This function gets a specified team project.
At the top level of the Team Foundation Server folder hierarchy are the team projects; the folders immediately below $/ in the tree. All folders and files under source control are directly or indirectly below the team projects. This function gets one or more team projects.
Gets the type of the current instance. (Inherited from Object.)
Overloaded. Gets a workspace.
Creates a shallow copy of the current Object. (Inherited from Object.)
Overloaded.
Overloaded. Queries for a list of labels applied to items in the database.
Gets information for all the passed merges in a specified branch, or between two specified branches. This function does not let you get information about deleted files or folders. If you want information about deleted files or folders, you can use the overload method that takes ItemSpec objects instead of strings. This function also does not give you details on which files within each changeset were merged or not merged. If you want information about the merged files you can use the QueryMergesWithDetails method.
Overloaded.
Overloaded. Gets the shelved changes for the specified query.
Shelving enables you to take a batch of pending changes and set it aside as a named shelveset. The changes in a shelveset can be restored later into your workspace or into another user's workspace. This function enables you to query for shelvesets.
Gets a list of workspaces that matches the specified name, owner, and computer.
Renames all instances of the specified check-in note field to the new specified name for the given team project folder.
Overloaded. Returns true if the server item of the specified type is in the database.
Team Foundation Server maintains a list of file types in order to control the multiple checkout option. Files that can be merged (text files) could allow multiple checkouts; files that cannot be merged (most types of binary files) generally do not allow for multiple checkouts. The Team Foundation Server administrator defines a list of known file types. When a new file is added to Team Foundation Server, its file name extension is used to identify its file type, and controls multiple checkouts. This method sends the list of file types to the server that is running Team Foundation Server. The new list of file types replaces the old list. Therefore, to add a new file type, you should first call GetFileTypes to get the current list. Then you can add your new type to the list and pass the complete list to SetFileTypes.
Global prmissions are permissions that apply to a server that is running Team Foundation Server, instead of to one file or folder on that server. The global permissions govern different behavior from item-level permissions. For instance, Checkin is an item-level permission and Administer Shelvets is a global permission. This function sets the global permissions for the specified users or groups.
Sets the permissions for items in the database.
Returns a string that represents the current object. (Inherited from Object.)
At the top level of the Team Foundation Server folder hierarchy are the team projects; the folders immediately under $/ in the tree. All folders and files under source control are directly or indirectly under the team projects. This function gets a specified team project.
TryGetTeamProjectForServerPath
At the top level of the Team Foundation Server folder hierarchy are the team projects; the folders immediately under $/ in the tree. All folders and files under source control are directly or indirectly under the team projects. This function gets a specified team project.
This method starts with a local path and finds a workspace that contains a mapping to that path. Workspace mappings are recursive: if you pass C:\code\CmdLine and no explicit mapping for C:\code\CmdLine is found, Team Foundation Server will search for a mapping to C:\code and then C:\. The search is restricted to mappings for the current user on the current computer.
This method removes a label from one or more items. For instance, you might use this to remove the file parser.cs version 12 from the label Beta 1 and then add the file parser.cs version 15 to that same label. If you remove all the items from a label, the label itself is deleted.
relies on the Microsoft Windows Active Directory to authenticate usernames. However, Team Foundation Server also keeps its own cache of user information to enable quicker access. In some circumstances, these two lists can get out of sync. For example, if your username changes in Windows, Team Foundation Server may still be holding onto the old username. When you use this function, it updates the Team Foundation Server user cache with the current information that Windows is storing about the current user.
Top
Properties
Name
Description
Gets the ArtifactProvider for this server.
Gets the identity used by the server to authenticate the user.
Gets or sets the flag to indicate whether the user asked to cancel the current operation.
Gets or sets the TraceSwitch object that represents the tracing level for all instances of VersionControlServer.
Gets or sets the command that is being executed on the client. The server records this information in the activity log so that server administrators can more easily understand the context in which individual calls to the server have taken place. This property is equivalent to the TeamFoundationServer.OperationName property.
Gets the GUID for the source control server's database.
Gets the TeamFoundationServer object that owns this instance of VersionControlServer.
Top
Events
Name
Description
Occurs when updating work items with a check-in.
Occurs when you check in a pending change.
Occurs when you delete an existing workspace.
Occurs before shelving a pending change.
Occurs before updating work items with a check-in.
Occurs when a new check-in is committed.
Occurs when a new shelveset is created.
Occurs when a conflict is created.
Occurs when a workspace is created.
Occurs when a shelveset is deleted.
Occurs when a workspace is deleted.
Occurs during a get operation.
Occurs during a merge operation.
Occurs when a new pending change is created.
Occurs when errors are detected but does not prevent the operation from completing.
Occurs when an operation finishes, such as when a set of changes finishes pending.
Occurs when an operation starts, such as when a set of changes start pending.
Occurs when a conflict is resolved.
Occurs when an existing pending change is undone.
Occurs when unshelving a shelveset.
Occurs when an existing workspace is updated.
Occurs when a work item has been updated with a check-in.
Top