Browse by Tags

Tagged Content List
  • Blog Post: How to: Query All Labels on a Folder Recursively?

    To do this, you can't call query labels with a wildcard character, you need to do the following: - Get all items blow $/Dir1 using GetItems - Loop through them calling QueryLabels on each one. Here's a code snippet: VersionControlServer sc = tfs.GetService< VersionControlServer >(); List < VersionControlLabel...
  • Blog Post: How to: Move a Shelveset to Another Branch?

    A very handy power tool is tfpt unshelve. It’s capable of migrating a shelveset from a branch to another, it does that by performing a baseless merge, so you will need to resolve the conflicts produced. The syntax of the command looks like the following: tfpt unshelve shelvsetName /migrate /source:$...
  • Blog Post: How to: Diff Shelved Files?

    You can run: tf diff /shelveset:shelvesetName;DOMAIN\ownerUserName Please note that this will diff the shelved changes against the unmodified version, not necessarily the latest version, just like what the you get from clicking compare in the shelveset details dialog. If you want to diff the shelved...
  • Blog Post: How to: List Changesets Between Two Labeled Versions?

    You can achieve that behavior by running: tf hist rootItemSpec /r /version:LstartLabel~LendLabel Here’s my scenario: tf hist /i File.cs Changeset Change User Date Comment --------- -------------------------- ------------- ---------- -------- 65 edit mohamedg 4/2/2009 63 edit mohamedg 4/2/2009 60 edit...
  • Blog Post: How to: View History of an Item Across Branches?

    You can use tfpt history /followbranches to follow the history of an item across branches. We are looking into supporting this in the history dialog in the next version . You can see which versions are ported over during the merge operation if you use tf.exe: tf merge BranchA BranchB /r merge: $/mohamedg...
  • Blog Post: How to: Switch Between TFS and VSS in Old IDEs?

    If you have an IDE that uses the MSSCCI provider, like VS 2003 or VB6, and you want to switch between TFS and VSS because you have projects on both systems, you will have to change the provider every time you switch. The thing is that setting is stored in the Windows registry, therefore, you will have...
  • Blog Post: How to: Copy Workspace Mappings?

    A common scenario that you may see is the need to share/sync workspace mappings amongst team members. A developer adds a new dependency in a certain project and changes his/her mappings to get this library, and everyone else in the team now needs to do the same thing. Since workspace mappings are stored...
  • Blog Post: How to: Switch Branches in a Workspace Without Getting All the Files of the New Branch?

    One of the new features added in VSTF 2008 SP1 is that you can switch to another branch in your workspace and you don’t need to download all the files of the new branch. TFS will only download the files that differ in the new branch, if you use tf get /remap . It will also tell the server that you’re...
  • Blog Post: How to: Move Your Workspace to Another Drive?

    A common problem occurs when the drive that contains your workspaces runs out of disk space, or when you find yourself in a situation that you have to move your workspace to another drive. This might get tricky because your workspace mappings are stored on the server side. TFS knows about the local path...
  • Blog Post: How to Get List of Changes in a Shelveset Programmatically?

    In a previous post , we used the command-line to list the changes in a shelveset. This time we are going to use an API to get the changes by calling: VersionControlServer.QueryShelvedChanges You have to be a valid user that can connect to Version Control, and you don't need a workspace to call this method...
  • Blog Post: Pitfalls of Baseless Merge

    A previous post was dedicated to show the benefits of a baseless merge, this one shows the pitfalls: When you perform a baseless merge, renames and deletes will not be merged If you get conflicts, the usual 3-way merge is not possible, you will have to resolve them using a 2 way merge The 3-way merge...
  • Blog Post: How to: List Changes in a Shelveset?

    When you run tf shelvesets shelvesetName /format:detailed you get the shelveset’s name and some metadata associated with it, but not the changes. To get a list of the changes in a changeset, run: tf stat /shelveset:shelvesetName;DOMAIN\ownerUserName The output is similar to that of a workspace.
  • Blog Post: How to: Disable Multiple Check-out on a Folder?

    There’s no direct way to do that. Multiple check-out is a property of a team project, it's not namespace specific. However, I can think of 2 alternatives using use the " Lock " feature, because that’s what TFS does when a team projects is set to exclusive check-out mode, it attaches a check-out lock...
  • Blog Post: How to: Find Distinct Changes by User?

    You can find changesets if you open Source Control Explorer and hit Ctrl+G or choose Edit > Go to… However, this shows changesets with no details, you have to double click it first. If you want to see detailed info all at once, you can use the command-line: tf hist /i /r /format:detailed /u:Adam itemSpec...
  • Blog Post: Deny: Revisited

    In a previous post , I talked about the deny option and how it’s evaluated. The documentation on MSDN is talking about conflicting permissions on the same level, however, in TFS2008 SP1, permissions are evaluated bottom up and the first match wins. If a user, Eve, is denied read on $/ but is a member...
  • Blog Post: Merges

    When you would like to know what changes have been merged already between a source and a target you can run: tf merges sourceItemSpec targetItemSpec Usually you would like to view the merge history recursively when you are using folders are branch roots (it’s recommended to use folders as branch roots...
  • Blog Post: How to: Find Source and Target Names for a Rename?

    If you view the history of an item that was renamed, you will see an entry like this in the history dialog: 123 rename username 06/02/2008 09:11:55 AM Comment Then you try to open the changeset details to know to old name, but it only shows the new name: NewName.cs rename $/Proj/ParentFolder If you want...
  • Blog Post: Thoughts on Setting Permissions on Non-existent Items

    Permissions in TFS are namespace based. The namespace doesn't have to exist to set a permission on. I can think of some scenarios when this is actually a requirement: You may like to set permissions on future items so that the permissions are effective whether the items exist or not: The users may add...
  • Blog Post: Deny

    Some thoughts about permissions, especially deny. Why deny? Because deny is the best way to apply the principle of least privilege . When a permission is set, it shouldn't matter what client is used to access TFS, the permissions are evaluated according to the credentials supplied. Permissions are namespace...
  • Blog Post: How to: Preview check-in conflicts?

    When you check-in, TFS will warn you that you have conflicts and the check-in fails. However, you may want to preview the conflicts without proceeding with the check-in. In this case you can run tf checkin /validate which lets you test checking in without actually doing it. You can also use it to evaluate...
  • Blog Post: How to: Change File Encoding?

    While merging or comparing files using the DiffMerge tool, and files have different encoding, you will see this message: "The character encodings on these files are different. Only files with the same character encoding can be merged or compared." If you look at the properties window of a file in the...
  • Blog Post: How to: Merge Items that were not Branched?

    This post is not about merging an existing item to an non-existing one, which will be a (merge, branch) change. This post is about merging items that already exist but they were not branched. One of our customers had this problem, he had three branches: A –> B –> C and he needed to port some changes...
  • Blog Post: Conflicts

    To understand conflict types please read this article on MSDN . In this post I’ll focus on conflicts that need you to manually merge the files. Let’s rule out binary files first because TFS doesn’t compare them, and doesn’t store deltas of them, it stores the whole file every time it’s checked in. TFS...
  • Blog Post: How to: Enforce get latest before check-in?

    One of our customers had this problem: developers on his team forget to get latest before check-in and they end up with many conflicts and sometimes they overwrite each others’ changes by mistake. One solution is to enforce a custom check-in policy: Follow the steps in this walkthrough to create a custom...
  • Blog Post: How to: Branch without getting any files?

    If you want to save time and network bandwidth when creating a branch, you can use tf branch /noget or /silent which tells the server not do perform the get operations while branching. The branch will be created but local copies of the items won’t be created on disk, however, they will be downloaded...
Page 1 of 2 (48 items) 12