Pages

Friday, March 26, 2010

Not getting Latest version - TFS

When two developers are working on same file which is checked out by both, so whenever one changes something and check in source, the new source has to be used. When one check out the source edited by other developer, first developer were getting the same version as the second have but not the latest source. So every time when you do the Get Latest Version you don’t get the latest source and you'll be prompted with the resolve conflicts dialog.

Let me explain the reasoning behind it. When you perform a get latest version operation to populate your workspace with a set of files, you are setting yourself up with a consistent snapshot from source control. Typically, the configuration of source on your system represents a point in time snapshot of files from the repository that is known to work together, and therefore is buildable and testable.

As a developer you working in a workspace, you are isolated from the changes being made by other developers. Ideally when you do this, you'll update the entire configuration of source, and not just one or two files. Why? Because changes in one file typically depend on corresponding changes to other files and you need to ensure that you've still got a consistent snapshot of source that is buildable and testable.

This is why the checkout operation doesn't perform a get latest on the files being checked out. Updating that one file being checked out would violate the snapshot and could result in a non buildable and testable.

As an best practice, Team Foundation forces users to perform the get latest operation at some point before them check in their changes. That's why if you attempt to check in your changes, and you don't have the latest copy, you'll be prompted with the resolve conflicts dialog.

And one more thing as I already told you that you not to use of "Get Latest from Solution Explorer" because it is far slower and less reliable than doing it from the Source Control Explorer. Solution explorer has to crawl your whole project structure and issue non-recursive calls, but Source Control window requires no parsing and issues one single recursive web service call.

No comments:

Post a Comment