Jump to content

Problems with VS Add-in


CodingGorilla

Recommended Posts

I was doing a lot of refactoring on a very large solution this evening; I was moving files in and out of different projects. Here's basically what would happen:

Let's assume I have 3 files:

File A
File B
File C

And 3 Projects:

Project A
Project B
Project C

If I moved 'File A' in from Project A into Project C (I'm using Resharper to refactor/move files), then File B would be modified to reflect the fact that File A was moved to a new namespace. This results in, as expected File B being checked out via (I would assume) the VS Add-in for Plastic. Now, I refactor 'File B' and move it into Project B, this results in an error that "This operation could not be completed because 'File B' is checked out" (something like that).

I just kept hitting OK, and letting Resharper finish its work. Now, when I went to check in all my changes, the changes to 'File B' would not commit. After the check-in processed, I didn't get any errors, I was left with a Pending Changes view that included the changes (one that says it was moved, the other that said that it was delete) that would not go away.

I tinkered around and was able to get everything squared away by various combinations of undo check-out, manual deletion, and then checking in again. So at this point, I'm ok, but I would imagine this is something that should be addressed.

Hopefully I explained that well; let me know if I can offer any clarification.

Link to comment
Share on other sites

Ok, AFAIK the "move between projects" doesn't work very nicely in Visual Studio, due to a VStudio limitation (I mean regarding source control). It works great within the same project.

BUT, we'll double check and let you know.

In any case, if that happens again, go to the Plastic GUI, pending changes view, and activate the "move detection". It will find the move for you in case it was not proactively done by the vs plugin.

Link to comment
Share on other sites

It happened to me again yesterday (I'm doing a lot of refactoring on a very large solution), I've figured out how to work around it though with minimal impact. But I think I have move detection turned on, because that seems to be a part of the problem, it detects them as both changed and moved and deleted. Where is that option though?

Link to comment
Share on other sites

Here's what this problem looks like in the GUI, and again, if I try to check in this change nothing happens, the change continues to show forever.

http://screencast.com/t/gDFOgDwZQCu

I'm not sure if that helps at all or not. What I did, in this particular case (and this seems to be the pattern), is Undo the checkout, which results in putting the OLD file back, and then just deleting the old file again (as it was already moved into the new project and checked in properly).

Link to comment
Share on other sites

I'll try to be as clear as I can.

There are two projects in the solution (for example), Project_A and Project_B.

Project_A has two files, File_A and File_B. File_B has code references to File_A, so [using Resharper] to do a Refactor->Move and moving File_A from Project_A to Project_B causes File_B to be checked-out and changed (it's references must go from Project_A.File_A to Project_B.File_A). Now, when I do the same refactor on File_B and move it to Project_C I get the error; presumably because File_B is already checked out.

What I have been doing to try and get around this is before I attempt to move a file, I check it back in. That results in a lot of extraneous change sets, but I can live with that.

Is that more clear?

Link to comment
Share on other sites

We're looking into the issue with the moves. The problem seems to be a well-known restriction with Visual Studio:

- If you move a file foo.c from project A to project B it won't send you a move notification, but a delete + an add. So, it breaks the whole thing.

We're working on a solution.

Link to comment
Share on other sites

Yes, I can see this in how Resharper does the Refactor. I can actually see it creating the new files and then deleting the old ones. Is it possible this also has something to do with Resharper? I'm not doing the actual move (or add/delete). I tell Resharper that I want to refactor the classes into a different folder/namespace and it does all the heavy lifting. Maybe it's doing something quirky.

Link to comment
Share on other sites

Actually it's a VisualStudio problem. Resharper calls the VS API to move/refactor files, but the VS IDE notify to the listeners (in this case Plastic SCM) DELETE+ADD instead a MOVE, when the move is from different projects. We're studying the cases and will implement a solution for these cases. It works fine when the files are in the same project.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...