views:

358

answers:

4

I'm seeing some weird behavior from VS2008 integrate with TFS 2008. When I delete a file from a solution from within the Solution Explorer and check it in, the file still appears in the Source Control Explorer.

In the Source Control Explorer the file appears having the value 'delete' under the Pending Change column. It also appears in the Pending Changes window with the same status and I'm forced to check it in from there.

Any idea whether this is "normal" and if it is, what the rationale behind it is? How can I avoid having to twice check-in the file deletion?

A: 

Edit: to reflect comment.

This is strange I don't get this behavior and nor does anyone at our sites. If we delete a file in Solution Explorer (select file and hit delete) it becomes a pending change. Then I can checkin the change. I have to ensure that I select the deletion in the check in/pending changes windows. Then It no longer appears as a pending change in Source Explorer. In fact I can check in and check out in either window and the change is reflected in the other instantly.

====

Deleted files remain in TFS. To completely remove a file you have to 'DESTROY' it not delete it. This is essentially source control in action. If you don't want to see the file then there is a setting in visual studio to hide them. Personally I prefer them there, as you can see the history and they are a visual reminder.

After deleting the file, you need to commit the deletion - this is essentially checking in the deletion. After this the file will remain in the source explorer but be greyed out. You can then do things like I mention above.

Preet Sangha
Tx for the answer. I'm not talking about files that have been deleted, checked out and now appear as greyed out (if the "Show deleted items..." option is on).My problem is before that - with files that I delete and check-in from the Solution Explorer, which I have to also check-in from the Source Control Explorer later. Why the double action?
urig
Re: Edit to reflect comment :). Note that what I'm complaining about is that checking-in from the Solution Explorer is not enough. Only checking-in from the Source Control Explorer truly deletes the file from the source control repository.
urig
A: 

What is the setting of Tools | Options | Source Control | Visual Studio Team ... | Show Deleted Files in the Source Control Explorer?

This defaults to unset, but if it has been set then deleted files will appear.

Richard
I think this settings is irrelevant. It refers to the display of files which have been fully deleted from TFS. The situation I'm referring to is a "partial delete" of sorts - The file is only marked as "pending delete" in the Source Control Explorer. Only after I check it in the S.C.E. does the above option determine whether it's visible or not.
urig
+1  A: 

How did you check in, exactly? My guess is you did it from the Solution Explorer context menu. When the Checkin modal dialog pops up, even though it shows your entire list of pending changes, by default only items that are currently in the solution will be checked.

This is another reason why I don't recommend invoking important operations from Solution Explorer. Automatically pending changes for you is convenient, but operations that modify state (eg Get, Checkin, Shelve) deserve more care.

Richard Berg
A: 

Ung,

This behaviour is totally normal - if somewhat confusing - as when you delete a file from a solution, that file is marked as pending delete in Source Control, but when you check in via the Solution Explorer, at the point of check-in that file no longer falls under the scope of the Solution.

If you delete files from a solution at any point, just remember to check-in from the Source Control Explorer.

Antony

Antony Gibbs