views:

110

answers:

5

I have some source code and I imported it into SVN. I forgot to update or check out it and made some changes to the files.

Now (understandably) SVN does not allow me to commit these changes. It says:

svn: '/home/name/folder' is not a working copy

What can I do now to commit these changes?

A: 

You should have a conflict.

If you get a conflict, you need to do one of three things:

  • Merge the conflicted text “by hand” (by examining and editing the conflict markers within the file).
  • Copy one of the temporary files on top of your working file.
  • Run svn revert to throw away all of your local changes.

You must try to resolve it !!! Have a look to

http://www.linxit.de/svnbook/en/1.2/svn.tour.cycle.html#svn.tour.cycle.resolve

Nadir SOUALEM
+1  A: 

After you put the files into svn, you need to check them out to create a working tree. You can leave your edited files where they are, and checkout a working tree someplace else. Then diff between your working tree and your edited files, you should see the changes you made. Copy your edited files onto your working tree, then check them in.

Ned Batchelder
That's the most logical explanation IMHO. The message doesn't look like a missing update on a local copy.
RedGlyph
+4  A: 

The error you are seeing: "svn: '/home/name/folder' is not a working copy" has nothing to do with not having run update. It means what is says:

/home/name/folder is not a working copy.

Here's a guess at what's happening:

  1. You imported a project (we'll call it "folder") into subversion.
  2. You neglected to check it out (svn chekout svn://MYREPO/FOLDER folder).
  3. You worked on the originally imported folder, which is not a working copy.
  4. Now you're stuck.

Here's my suggestion for a solution:

  1. check out your "folder" from svn already!
svn co svn://MYREPO/FOLDER folder.svn 
  1. copy your edited files from 'folder' into 'folder.svn', replacing the copies that were there.
rsync -r folder/ folder.svn
  1. run svn status. you should see that there are local changes.

  2. don't forget to add any new files with svn add.

  3. svn commit your changes.

  4. throw out 'folder'. work in 'folder.svn' from now on.

bendin
he just add the error message ...
Nadir SOUALEM
Wow. That is exactly what happened. I am not going to try this tonight. It is 3 am already. Will try it tomorrow, but I have a feeling that this will work. Thanks!
Niyaz
A: 

bendin's answer is correct. However, if you don't care about keeping the original version, you could also just start over and re-import your folder as it is now. You'll have to remove the old version first (svn rm -m '' oldFolder).

JW
A: 

In order to convert your regular directory into a working copy, you can do the following:

svn checkout --force svn://MYREPO/FOLDER /home/name/folder
svn add --depth infinity /home/name/folder/*

Now all the modifications you’ve made to files since the import will show up as local modifications, and everything else in the folder will be added to version control.

This makes it unnecessary to do any copying/pasting/deleting.

Michael Hackner