Pages

Wednesday, March 14, 2007

Subversion Without Network

My Friends and I have a small project out side of work. We meet on weekend and its been going for almost a year now.

At the beginning of our project we decided to use a repository server and decided that we'll use CVS. We struggle a lot trying to install the CVS server, but finally we have it running in a couple of weeks (yeah its not a great achievement :( )

In the middle of our project we have some misfortune. And because of that, our cvs server got shipped away (don't ask the details :P). Because its been months, since the start of our project, none of us remember the complete step to install the CVS server. Remembering the pain searching docs, etc, to install our CVS server in the first place, we decide not to install the CVS server and focused on our development.

I have reason for this, its not only because we are lazy or ignorant :P. We are waiting for the release of subclipse 1.2.0, An eclipse 3.2 (calisto) plugin for Subversion(SVN). Actually in the start of our project we already favor SVN over CVS. But the lack of stable plugin for calisto force us to use the alternative, CVS.

The story goes on and we successfully install SVN server and Subclipse.

As i mentioned earlier, we meet on weekend for this project. And do most of the work on weekdays after work. I don't own any laptop, so in the weekend i usually bring my source in an USB and manually merge the code. But since we have our SVN server setup, something gotta change.

After a couple reading of the subversion documentation, we finally find a way, so i can merge my source with the repository without have to buy a new laptop :P

Here's the complete step that work for me :
  1. First we set an eclipse workspace for me in one of my friends computer that connect to the repository.
  2. I plug my USB that contains my project from my home workspace.
  3. Using windows explorer, I search my src folder in my USB for all of .svn directory and delete it. Remember search the src folder and other folder that you need to commit like context folder in a web based project.
  4. I copy the src folder (and context to if you're working with a web based project) , from my USB to my workplace in my friends computer.
  5. I start eclipse in my friends computer
  6. Switch to my workplace
  7. Eclipse mark all of the changes i made at home.
  8. I Commit the changes to the SVN repositories.
  9. Done, clap your hands >:)
Actually at first try we try to copy all of the project source, from the USB to my workspace, but it didn't work. When we start eclipse, no files is marked changed. After reading the documentation, we find the reason. Its how subversion work.

After you initially add your files to subversion repository. Subversion create a .svn directory on your local folder, the folder is hidden. It stores a copy of the files in your current directory, and use it to determine changes you made to the files and directory.

PS : I have my own subversion server in my home, and commit the changes i made to the repository before i copy it to my USB. That's why my .svn repository don't mark that any changes has been made since last time i commit to SVN repository when i copy my project source to my workplace in my friends computer.

No comments: