56

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.

Community
  • 1
  • 1
jcolebrand
  • 15,889
  • 12
  • 75
  • 121

9 Answers9

60

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).

Jason
  • 8,400
  • 10
  • 56
  • 69
jcolebrand
  • 15,889
  • 12
  • 75
  • 121
  • What I did was: `View -> Other windows -> Source Control Explorer ` right click on the project and `Undo pending changes` It gives you a list of files with pending changes and you select either to revert or not. VS2012 – mchar Sep 05 '19 at 13:00
50

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.

Kingpin2k
  • 47,277
  • 10
  • 78
  • 96
Pete Stensønes
  • 5,595
  • 2
  • 39
  • 62
  • 2
    Hopefully my findings helped you figure out what was going on here so you didn't have to spend too long looking for it. – jcolebrand Mar 06 '12 at 14:57
  • Yes they did (+1) but in the usual indrect way these problems normally work them selves out :-) – Pete Stensønes Mar 06 '12 at 15:26
  • Unfortunately I know exactly what you mean. – jcolebrand Mar 06 '12 at 21:39
  • 13
    I think it's unfortunate (and a bit silly) that TFS can't just show you the source and destination files as merge conflicts, and give you the change to use a merge tool to merge the files. – Jerad Rose Mar 29 '13 at 21:31
  • In Visual Studio, neither my source or target solution showed which files I needed to undo. I had to right-click the target solution in Source Control Explorer and choose "Undo pending changes". Then it showed which ones I needed to undo. – Jason Aug 17 '18 at 16:24
5

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

Mark Freeman
  • 1,155
  • 3
  • 24
  • 42
  • 2
    Unfortunately, tools released in March 2011 don't help me in May 2010. Additionally, we've since moved to FogBugz and Kiln (mercurial). I'm not sure, however, that you're presenting a new answer to this problem. You are suggesting that I use an unshelve tool (which I already had in May 2010) but my initial problem really revolved around having deleted the file I needed to unshelve. Thanks for sharing your answer, I'm just not sure it fits the question. – jcolebrand Jun 29 '11 at 21:28
  • 4
    One of the important things about Stack Overflow is that the questions and answers don't just help YOU, they help anyone finding this page. I just found in 2015 and this answer was useful to me as it seems to represent the best solution to my problem. – Daveoc64 Apr 16 '15 at 09:07
3

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.

user594315
  • 41
  • 2
  • 1
    Excellent, glad you got that resolved, hope my question/answer here led you to that solution. Thanks for sharing the additional information. – jcolebrand Jan 28 '11 at 19:49
2

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.

Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
1

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.

peter70
  • 1,053
  • 16
  • 31
1

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.
OutstandingBill
  • 2,614
  • 26
  • 38
0

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.

Kapil
  • 191
  • 2
  • 5
  • @jcolebrand I read your answer now. Yes that is the exact reason what was causing the issue. I missed your point. I posted the link because it had steps to replicate which helped me. – Kapil Nov 06 '15 at 15:39
0

Recent answer,

Pay attention and be sure that if you have other branches Test or Main (we assume we're merging from Development environment), your local files are up to date. Take its latest version from the environment to which you merge.