Wednesday, July 21, 2010

Using subversion 2: Getting your project from the repository

Suppose you are working on some brand new machine. You've just installed Eclipse and you want to get your source from the repository. It's easy. Just go to the SVN perspective and add the repository. Find your source and right click and choose checkout. Now you have the source on your local machine.
Next, you will want to save your changes. This you do by committing, though I think I already mentioned it. Another common thing you will want to do is get any new changes from the server. Suppose both you and a friend are working on the same project and you have been waiting for him to complete a particular class so that you can use it. Once he's finished and committed his changes, you can add them to your working copy of the source by going to the java perspective, right clicking on the project going to team and clicking UpdateToVersion.

Tuesday, July 20, 2010

Using subversion

The first, simplest thing to do in subversion is to add your code to the repository. To do this, go your Java perspective and right click the project you want to add to the repository. Go to Team and then choose Share Project. Once it is shared, you will not see it in the repository. You have to commit your changes, and everything you have written so far is a change. So go back to the Java perspective, right click on your project and go to Team/Commit. Now everything you have written in that project will be added to the repository.

subversion SVN

So this is my first, technical computer sciency blog post. It concerns what is called a versioning system. A versioning system allows you to have access to a large, shared collection of written work (like programs, or documents) in such a way that any new additions are kept organized. For instance, appartently though I have not managed to do it yet, with a SVN like Subversion for Eclipse, if you make a change to your code it is saved but so is the old version. You can, theoretically, see all instances of the code back to its inception. If you want to undo a change, you simply go the version that does not include that change. In any case, this little blurb is actually about how to install the versioning system known as Subversion in Eclipse.
  1. Open Eclipse and go to Help/Install New Software
  2. Press Add to add a software repository
  3. See the box appear that asks for the URL...
  4. ...which you find here http://subclipse.tigris.org/ and go to Download and Install
  5. (On this page you will see official instructions for adding Subversion)
  6. Scroll down a bit to find the various urls and chose the newest one :1.6 (though it depends on the version of Eclipse you have).
  7. paste that url back into the box in Eclipse
  8. Choose all the available software to be installed and go forward until it starts installing
  9. Restart Eclipse
  10. Go to Window/Preferences and click on Team/SVN
  11. in the SVN interface chose (Pure Java).
  12. The configuration location should be default
  13. Go to Window/Open Perspective...other and click on SVN Repository and click OK.
  14. In the blank space in the SVN repositories view right click New/Repository Location where you will enter the location of your repository which you should get from your administrator.
  15. Give your password when prompted and this should complete the process.
  16. I fyou have any problems, you might solve them by deleting your entire Eclipse install and reinstalling the latest one

Tuesday, July 6, 2010

version control

Marcus got me onto some free version control software. I am going to try to use it for my project. The software is called Git and I have never used a VCS before. I'm sure it will make me pull my hair out at first, but let's just see...