Force old revision to the current revision - visual-studio-2010

I made a boo boo with a with a Visual Studio 2010 project on TFS2010, and instead of spending hours trying to fix it did i decide just to go 2 revisions back, and continue from there, which worked fine.
But how can i now make my local version the current revision? When i try to commit i just get a version mismatch error.

Open the pending changes conflicts dialog:
Top Menu -> View -> Other Windows -> Pending Changes
If you want to make your local version the current version. You will be presented with a list of conflicts.
For every conflict select: "Keep Local Version"
Here is an example of what your screen will look like notice the "Keep Local Version" option to the right of the item in question.
Check it in and you should be good to go.

You check everything out with your local copies and during check-in you will encounter conflicts. You will resolve them by overwriting server version and accepting your local copies.
Voila, your local copies are latest now.

Related

Unable to perform branch, database update error thrown

I am trying to branch a directory in TFS using the Source Control explorer, however whenever I do, I always get this error:
TF400962: There was a database update error. Please try your operation again.
This occurs after confirming I would like to branch after it informs me that it will be committed as a single operation, pending changes will not be created and that it cannot be canceled when it is started.
I have been stuck on this for a while now and I can't seem to find any solution to this, here is a list of things I have tried.
Made sure the Target Branch Name is below 255 characters (As suggested here). I also made sure the whole path on my machine was also less than 255 characters.
Changed workspaces.
Updated Visual Studio to the latest version.
Restarted Visual Studio.
Restarted my machine.
Branched another directory (To see if the directory I need to branch isn't throwing the error).
Made sure connection to the TFS server was correct.
Checked that I had the correct settings in the workspace.
Downloaded the directory I am trying to branch to my PC.
I have ran out of ideas and it really is frustrating me. Any help would be appreciated. I'm using Visual Studio 2017 Enterprise now running on the latest updates.
Check if you had a deleted branch in the path you are trying to branch to.
Steps to reproduce:
Have code at $/path/to/main
Branch from $/path/to/main to $/another/path/dev
Delete $/another/path/dev
Try to branch from $/path/to/main to $/another/path/dev/branch
-> TF400962
Problem seems to be that $/another/path/dev/branch overlaps with deleted branch $/another/path/dev
Resolution:
Show deleted elements in TFS Explorer
Convert deleted branch $/another/path/dev/branch to regular folder
Branch from $/path/to/main to $/another/path/dev/branch
-> Success!
The error you are getting a generic error that could happen because of any TFS SQL Server related issue. Please check events logs on your TFS's SQL server machine. You might find more information there.
There is more information here
https://connect.microsoft.com/VisualStudio/feedback/details/1128642/tf400962-there-was-a-database-update-error-please-try-your-operation-again
Make sure your TFS DB is not out of disk space.

How can I tell what will be updated if I use "Get Latest Version"?

I have a Visual Studio solution and am using TFS for version control.
When I've made a bunch of changes to my working copy of the solution, the Team Explorer window will show me all the files that I've changed, and allow me to compare my version with either the workspace (original) version, or the latest version in TFS.
However, before I check in my changes, I first want to integrate any changes that have been made (by other people) to the latest TFS version since I got the source from TFS.
I could do a Get Latest Version and hope for the best. However, I would generally prefer to know what will be changed, and have the opportunity to look in detail at those changes, before overwriting my local files.
Is there a way to either compare my workspace (original) version against the latest version in TFS, or to see what the effects of a "Get" will be before I actually execute it?
To be useful, this would have to be a at a solution level - I would not want to have to go through each individual file.
Use Compare... and select Latest Version. That's best executed from the commandline or the Source Control Explorer.
If you compare "Latest Version" (remote) with "Workspace version" (local), then it'll tell you what has changes on the server since the last get-latest.
If you compare "Latest version (remote) with "Latest version" (local), then it'll tell you what has changed both locally and remotely.
The command line is your friend you can use the /preview switch to see what will happen if you do the get
tf get $/MyTeamProject/MySourcePath /recursive /preview

How to resolve changes between local and shelveset

I have local changes on my machine.
My coworker has shelved changes with files that overlap my changes.
I'd like to pull my coworker's shelveset and resolve the conflicts.
However, when I try to unshelve, I get an error message :
"The item ... has an incompatible pending change."
How can I merge in my coworker's changes?
I ran into this the other day and a co-worker gave me this great simple tip.
There is an easy way to do this using Visual Studio Power Tools. You can perform the unshelve and merge together by using the tfpt unshelve command from a Visual Studio command prompt. Make sure your active directory is a directory that is mapped to your local workspace otherwise you may see "Unable to identify workspace". When you run the command you'll be presented with a dialog to choose your shelveset. After that, you will receive an additional dialog that allows you to merge conflicting files.
You will first need to undo any of the changes that you have done in the files that are also in the shelved changeset. You can then unshelve and put your changes back.
Another way is to check in your changes and then unshelve. Or the other way around, first check in the shelved changes and then get the latest version where you will have to manually handle any conflicts.

Subversion tree conflicts when attempting to merge near identical branch

I have an iOS project under Subversion source control and I am using Cornerstone as my SVN client. (I have also tried using XCode for this as well)
I've had numerous problems merging branches, and hope someone can help!
In the simplest test I have done, I have:
Created a new branch from the trunk
Made one small text change in one file in the new branch
Immediately attempted to merge the change back into the trunk from the branch.
When Cornerstone analyses the merge contents, it reports lots of tree conflicts and newly added files.
Other (potentially) relevant info:
I am the only person working on the project at present, so there are no other changes being made.
I have tried merging from branch-branch, trunk-branch, branch-trunk all with the same result
The server is using SVN v1.4.2, my client is v1.6.17. I am suspecting that this may be the cause, but am looking to get this confirmed if possible.
Thanks!
It appears that the problem is due to the server being v1.4.2.
I deleted my existing working copy and checked out a fresh copy, ensuring that the SVN version was set in the check-out dialog box to 1.4.
Now, when I attempt a merge, I only get the options to "Cherry Pick Changes" or "Advanced Merge". The "Synchronise a branch" or "Reintegrate a branch" options no longer appear, so these must be options not supported on 1.4.2 and be the cause of the conflict explosion I was seeing.
In summary, to merge between my branches it appears that I have to select the specific revisions that I wish to merge.

TF203015 The Item $/path/file has an incompatible pending change. While trying to unshelve

I'm using Visual Studio 2010 Pro against Team Server 2010 and I had my project opened (apparently) as a solution from the repo, but I should've opened it as "web site". I found this out during compile, so I went to shelve my new changes and deleted the project from my local disk, then opened the project again from source (this time as web site) and now I can't unshelve my files.
Is there any way to work around this? Did I blow something up? Do I need to do maintenance at the server?
I found this question on SO #2332685 but I don't know what cache files he's talking about (I'm on XP :\ )
EDIT: Found this link after posting the question, sorry for the delay in researching, still didn't fix my problem
Of course I can't find an error code for TF203015 anywhere, so no resolution either (hence my inclusion of the number in the title, yeah?)
EDIT:
I should probably mention that these files were never checked in in the first place. Does that matter? Can you shelve an unchecked item? Is that what I did wrong?
EDIT:
WHAP - FOUND IT!!! Use "Undo" on the items that don't exist because they show up in pending changes as checkins.
I had deleted the files in trying to reload the workspace, even though I had shelved the changes. Then VS2010 thought those files were still pending to save. I didn't need that, so I had to figure out to "undo" the changes in Pending Changes.
Then I could unshelve.
It thought I had two ops (unshelve, commit-for-add) going simultaneously, and I thought I had only one op (unshelve).
This is a slight aside to the OP's question
You can get a TF203015 when you try and batch merge a multiple changesets from one branch to the other without due care.
Consider a situation where you have a MAIN trunk and a DEV branch. You branched DEV from MAIN and have diligently worked away at a feature in DEV; checking work back into DEV as you progressed. Now fast forward a week or two. You are now feature complete and want to merge back into MAIN.
This is where one of our devs hit this error.
He had been working on one solution for weeks, and checking changesets back into DEV periodically, so wanted to merge a non contiguous series of changesets back into MAIN.
So he picks the merge option, selects the first changeset; merges without issue, then immediately went to merge the next changeset; and bang TF203015, and its very unhelpful test in the output window; incompatible pending changes.
After a little fiddling around we now realize what is going on here; the first merge created a pending change in MAIN for the developers solution. The next merge attempt was also changes to the same solution, which would require TFS to "queue up" a second set of pending changes to the same files. It cant do this.
So in this scenario TF203015 means; "The destination branch already has pending changes on some files that are changed in this changeset. Please resolve and commit the destination branch changes before performing this merge operation"
The solution; after each merge operation our developer tests the workspace for MAIN and commits the pending change caused by the merge, then goes back to DEV and repeats.
Actually sensible and simple, but masked by a very obtuse error message.
You can use the Team Foundation Server Power Tools March 2011 (http://msdn.microsoft.com/en-us/vstudio/bb980963.aspx) that includes the command tfpt unshelve.
Once the Power Tools are installed, open a Visual Studio command prompt, change to the directory that contains the project of interest, and execute the tfpt unshelve command. It will unshelve and display the merge dialog so you can resolve the conflicts.
I credit this blog post with helping me find this solution: http://fluentbytes.com/the-how-and-why-behind-tf203015-file-has-an-incompatible-change-while-unshelving-a-shelve-set
I had what appeared to be the same issue but I had created a branch after shelving my changes and I wanted to unshelve those changes to the new branch.
TFS cannot unshelve to a different path than the path upon which the shelf was created.
Solution: I unshelved back to the original branch then I used beyond compare to merge the changes from my original branch to the new branch and checked in.
It could also be that after you create a folder in say a "Test" and you want to merge from dev to test, that you do not have that newly created folder structure checked into TFS - You will /can also get this error message.
Thus this message error CAN occur without anything to do with SHELVESETS as well for others coming from google and finding this page.
This might be the same as jcolebrand's answer, but I'm afraid I found the phrasing there a bit abstruse. Sincere apologies if I'm just repeating.
In my scenario the incompatible pending change message was presented because I was trying to roll back multiple changesets, and the same file was affected by more than one of those changeset.
In my case I did not want to commit until all the changes had been rolled back. I believe if I had been able to commit after rolling back each changeset, the error would not have happened.
The method which worked for me was as follows:
I opted to roll back one changeset at a time. I found using the command line was actually a more informative way of doing this because it lists all the conflicts, whereas I think the VS UI rollback just lists the first.
While rolling back a changeset, if there was an incompatible pending change, I had to undo my workspace's pending changes for the affected files.
When all the changesets had been rolled back, I had to manually revert the files which had experienced incompatible pending change. Mostly this could be achieved simply by getting a specific version of the file (the "last-known-good" version before all the bad checkins started). But for some files where there had been both desired changes and undesired changes, I got the "last-known-good" and manually applied the good changes to it.
This link resolved my issue:
https://blogs.infosupport.com/the-how-and-why-behind-tf203015-lt-file-gt-has-an-incompatible-change-while-unshelving-a-shelve-set/
The reason was pending change in the same work space create an incompatible change. So undo the pending changes and try unshelve. This should resolve the issue.
If you have two branches MAIN(target) and DEV(source), now you want merge DEV into MAIN, then all files you want merge from your source, must not be older then the similar files in your target branch.
For example: you have an changed file test.cs in your DEV branch, changed at 14.03.2016. In your MAIN branch you have test.cs changed at 15.03.2016. So the target is newer then the source file and you have TF203015.
Solution: navigate in TFS Explorer to the conflict-file and merge it explicit. TFS will open the conflict manager and you can merge the conflicts by hand. Following you can merge the selected changeset.
Remarks: If you have more conflicts, you must navigate to each conflict-file and merge it explicit, so TFS opens the the conflict Manager and you can merge it by hand.

Resources