Brian
Brian

Reputation: 115

svn: after updating project to new revision files are copied to the computer but are not added to the project

I am using the latest versions of Tortoise and VisualSVN client/server. I tried update to previous revision and back, but the situation has not changed.

Anyone knows why this happens?

@Ben Yes, I know it. But you don't understand my problem. For example, one guy commit a file image.jpg. I updated my working copy of project to new revision. But this file is not added to solution, and there is an error when building the solution (for example) that there is file image.jpg not found. But I can manually add this file to solution because it is in my project folder (it downloaded after upgrading to latest revision). You understand me?

UPD.

OK. Thanks to all who are trying to help me. Maybe I'm not very clear explains, so try again in more detail.

I have a server (PC) with VisualSVNserver and repository. I have TortoiseSVN and VisualSVN plugin for Visual Studio on my PC.

We worked on the project (I'm not one), and successfully commit changes and checkout. After one commit (I don't know number, there were several) there was a this problem.

If I update VisualStudio, do I see the file in the repository, but the solution file ignores it? Or, do I not even see the file in my Visual Studio layout.

If I don't see the file in VisualStudio, do I see the file using Windows Explorer? (And make sure Windows Explorer is setup to show invisible files!)

Yes, yes, after this commits the repository contains changes. I see it in repository (through the web server interface), and I see it using Windows Explorer (on my PC, in the folder with local working copy of project), but I don't see it when I open solution in VS (I can use in Solution Explorer Add->Existing item and add this files, but I think it's wrong).

So I tried update to previous revision and back (I thought it could solve my problem), but this does not work.

Yes, maybe this because some files were not added to the repository INSIDE of VS, but how I can fix project? (now I have broken project).

If I do a clean checkout with TortoiseSVN without VisualStudio, do I see the file?

What you mean "without VisualStudio"? I always use VisualSVN plugin for this. I do a clean checkout but it does not solve the problem.

Upvotes: 1

Views: 2546

Answers (2)

David W.
David W.

Reputation: 107040

Are you using VisualStudio? You should be using an INTERNAL Subversion plugin for VisualStudio and not TortoiseSVN. My personal favorite is AnkhSVN. However, VisualSVN does make one too. Are you using the VisualSVN plugin into VisualStudio?

Your description isn't describing too much:

I am using the latest versions of Tortoise and VisualSVN client/server. I tried update to previous revision and back, but the situation has not changed.

Anyone knows why this happens?

What's the situation that didn't change? What do you mean you updated to the previous revision and back?

Subversion does not change the repository until those changes are successfully committed to the repository. You can add and delete files. You can modify files. But, until you commit those changes, no one else will see them.

And, in order for someone to see the most recently committed changes, that user has to update their working copy. Did the user who add the image.jpg commit their changes as well as added the file? If they didn't, that's the problem you're having right there.

You talk about the file not being added to the solution.

  • If I update VisualStudio, do I see the file in the repository, but the solution file ignores it? Or, do I not even see the file in my Visual Studio layout.
  • If I don't see the file in VisualStudio, do I see the file using Windows Explorer? (And make sure Windows Explorer is setup to show invisible files!)
  • If I do a clean checkout with TortoiseSVN without VisualStudio, do I see the file?

If the file is there in the clean checkout directly from TortoiseSVN done completely outside of VisualStudio, it means that the file was successfully added, but that VisualStudio is ignoring it. This will happen if the user added the file OUTSIDE of the VisualStudio IDE (probably directly with TortoiseSVN). This is a big fat honking no-no.

In order for VisualStudio to work, you must let VisualStudio process all files. You add the file inside VisualStudio. This allows VisualStudio to know about the file and make sure it's in the solution file. If you're using AnkhSVN, it will automatically be added to your Subversion repository when you add the file INSIDE of VisualStudio. (You still need to commit the change into Subversion in order to have the file actually in the repository, so others can fetch it).

IDEs like VisualStudio are designed to make your life easier. These IDEs track your files and make sure that they're included in the builds and placed in the right spot in the final deployable artifact. In the old days, we wrote Makefiles by hand (we didn't have keyboards back then, just an inkwell and a quill). Makefiles were hard and complex. Take a look at some examples. IDEs do this for you, so you can concentrate on writing your program and not on making sure what you have builds correctly.

However, for an IDE to do its job, you must practically do all of your work in your IDE, so the IDE knows what's going on. When you add, move, rename, delete, or modify a file, you must make sure it's done INSIDE of the VisualStudio IDE. That way, VisualStudio knows about the file and can modify its solution as needed. The IDE also knows about temporary invisible files such as the *.suo and *.user files in VisualStudio, and knows not to add these types of files into the Subversion source repository.

I'm not sure if this answers your question. You need to be more specific. Give us some better examples. Tell us exactly what steps you did and exactly what you saw.

Browse the other questions on this site and see some examples of some good detailed questions. If I didn't answer your question. Don't merely tell me I don't understand your problem. Improve your question, so I can understand. Right now, I'm just shooting in the dark making terrible assumptions about what your issue could be based upon my past experience.

If this does help, select the checkmark by the answer, so we know this question has been answered. Also add a comment explaining how this helped. And, still go back and reword your initial question to make clear exactly what the problem was. This way, if other people have similar issues, they can search for this question, and see what the solution will be.

It makes this site a bit more useful to the millions of programmers who depend upon this site.

Upvotes: 0

Ben
Ben

Reputation: 8905

Visual Studio keeps a list of files in a project file of its own. If you want to add files to a project and have other people pick up those files in their project, you will need to put the project files under version control as well.

Upvotes: 1

Related Questions