04 December, 2008

Automatically commit to SVN server

I have three pc boxes to play around: laptop, desktop and company box.  I use all of them in parts of a day: working hours for company, laptop at home and sometime with dekstop (while my brother uses the laptop). In that case, there're a lot of personal data that I need it have to be avaiable on all boxes (of course it should be synchronized too). The free SVN hosting of Google Code came at right time . I really love that service, except it allows anynomous to browse repository tree (I have some private data) but it isn't matter.


The issue shows up when you have three local copy for your repository. Sometime I save or add new file at company and forget commiting to server. Then I get to home and is unable to continue work  . Unfortunately, it happens usually because i don't own a good memory. Therefore, I need to find a solution for this problem.

First, I thought about finding a cool software that monitors changes in SVN local copy and commits automatically. And I failed. Even I can find out, I don't think it's freeware. So with that idea, I then tried to find an anternative way.  Eventually, I saw the sunligh at the end of tunnel ^^.

Why don't we use a combination between svn command line and Scheduled Task of Windows. That's the point I started writing two small script for updating and commiting task. It is somehow like this

===================
e:

cd "E:\GoogleCodeProject"

"c:\Program Files\Subversion\bin\svn.exe" commit -m "Automatically commit on dekstop"
====================


Afterthat, I created two task in Scheduled Task (remember start Scheduled Task service before). With updating script, I set it will be run when user login to windows. And with commiting script, I put it to the task which was set to run at 30m interval. But default Windows doesn't support that type, it only allows hourly, daily, monthly, ... Wait, the real supporting from Scheduled Task stayes in Advanced Setting


 


Finally, I got the acceptable solution. How wonderfull it is 

Blogged with the Flock Browser