SVN Help

Started by
5 comments, last by Zahlman 17 years, 2 months ago
Hi. I started to work with sourceforge's subversion system, I commited a file for test, and then deleted it. But the problem is that when I commited the file, that file was marked as revision 1, and when I deleted it, it was revision 2. The cuestion is, how can I delete a previous revision? I don't that test file visible. Thanks.
Advertisement
I think thats the point of SVN, any change to it is a new revision, you cant change an old revision by replacing it, the change is a new revision.

The use of it is so you can work with large projects and people can take the most up-to-date version and add to it, then when they submit it, SVN does all this neat stuff to ensure the code was added to the latest version.

I hope that answered
I commited some test files, and then deleted them. I made that for test, so I wanted to delete these useles revisions, but it seems that's not posible.
Thanks for the answer :)
If you like really want to like, have the clean slate thing, you can use svnadmin obliterate, but like, the point is for it to log everything that's happened including file deletions and such.
I understand what you mean Martin.

I think they do make it hard to delete files (and I dont know how, because there's many types of SVN, and I've never used that one) is so no one can like kill the projects progress as an attack, if that makes sense. Also if you made a mistake, or decide to go back and get it later on, etc.
In TortoiseSVN (windows plugin) you can use the RepoBrowser to delete the entire directory and just start over.
The *point* of SVN is to back you up in case you make a mistake (which includes deleting something that you find out later you need after all). The "current revision" contains all the stuff that is "normally" visible in the repository, but actually you can use more advanced requests to get the repository as it *was* at any given revision number. So if for example you change some algorithm in your code, and play around with it for a few revisions, and eventually decide that the old approach was better (it happens, more often than you think), you can grab the old version of the source file to see how you were doing things before, and integrate the other changes.

Under the hood, SVN isn't really storing copies of your files; it's storing these weird database-archive files that are capable of representing several files at once (they contain some metadata for example that says where one file begins and the next ends, what the filenames are, etc. Kind of like a ZIP archive does), and actually most of these files don't really represent your files, but instead *differences* in the file from one revision to the next. (Actually, more like differences *between the revisions themselves*: the file contents might represent for example "we deleted foo.png, and deleted line 78 from load_all_images.cpp".)

The SVN application is capable of using these to "construct" what the files *must have been* at some revision in the past, even though it doesn't necessarily have copies of those files any more. Further, you can use SVN "diff" and "patch" tools to mix and match changes made by various revisions, on a per-file basis... and also to let someone else work on a source file at the same time that you do, then see what changes you and the other guy made, and "merge" them together (although if you both changed the same *part* of the code, i.e. your changes overlap, then you will be asked to step in to figure out what to do - you have to resolve this "conflict" manually, because there isn't a solution that works in general.)

This topic is closed to new replies.

Advertisement