How to check remote changes and update local copy ?

ALIENQuake
ALIENQuake
Hi,    It's my first atempt to do some auto-updating svn repo so i need you help. I have Debian server. I want to make a simple solution that:    1. It will check if there was any new commit at http://miranda.googlecode.com/svn/trunk/  2. If yes then it would run "svn update" command in "/lib/svn/miranda/"    That's it. It will be used only to get all new commits automatically, without need me to manually run "svn update" in "/lib/svn/miranda/"    How can I achieve this ?

Last updated

squeekjjy
squeekjjy
i would like you to read the section which is called Updating Your Website After SVN Commit  if i am correct in understanding your situation, this should help you create a script which auto-svn update's after a commit has been done, so i hope this helps, if you are having any issues please leave another comment :)  http://brennydoogles.wordpress.com/2011/10/21/using-subversion-to-automatically-publish-your-website/
ALIENQuake
ALIENQuake
I don't have direct access to the "remote" svn repository. The detection must relay on some "check if there is new revision in /trunk" and then do an svn update.
squeekjjy
squeekjjy
so you dont want something which will actually commit files but a script which will check to see if new commits/changes/revision's have been made then run an svn update automatically ?
ALIENQuake
squeekjjy
squeekjjy
ok so are you hoping to run the check command then have the auto svn update,  i know its a silly question but just helps me understand exactly what and how you want it to happen :)
squeekjjy
squeekjjy
ok so are you hoping to run the check command then have the auto svn update,  i know its a silly question but just helps me understand exactly what and how you want it to happen :)
ALIENQuake
ALIENQuake
I don't know. Maybe some script with wget of log page, cut(grep) everything except first line with revision, compare number with local copy and it it is not equal then run "svn update" ? And set this script to run every minute ?
squeekjjy
squeekjjy
well wat i was thinking what might be more likely is something abit like a .bat file in windows, where you double click the file it it runs all the commands for you in the terminal, but if your wanting something which will run ever minuit then have a look into this programme, SvnNotifier, from what ive read it tells you if something has been updated and it may also contain a section which allows you to add a timer into it to allow svn update to run every minuit but i havent used the programme before so i cant tell you for sure, if i find anything thing else ill let you know or if you rither me find something else then let me know but right now im trying to find a script file to which i can create the double click file which automatically runs the terminal and updates if requried, then if u needed it to run every minuit then you could see if there a scheduler to which would run the file every minuit, what you reckon, sound good ? (assuming its possible)
squeekjjy
squeekjjy
ok ive found this on the net,  open gedit or nano or anything and type this into it ( well copy and paste )    #! /bin/bash    REMOTE_REPO="http://miranda.googlecode.com/svn/trunk/"  LOCAL_REPO="/lib/svn/miranda/"    REMOTE_REV=`svn info $REMOTE_REPO | grep '^Revision:' | awk '{print $2}'`  LOCAL_REV=`svn info $LOCAL_REPO | grep '^Revision:' | awk '{print $2}'`    if [ $REMOTE_REV -eq $LOCAL_REV ]; then   exit 0;  else   # Run your commands here.   cd $LOCAL_REPO   svn up  fi    ok after you have done that, save the file in your documents or somewhere you can easily remember for now, run these commands in order  cd Documents  chmod 755 txtfilename    after that i would like you to run the file and see if it exicutes and does it jobs, if it doesent work then please let me know    EDIT : http://askubuntu.com/questions/96886/how-to-make-svn-look-for-if-there-is-an-update-once-a-minute-and-if-there-is-cal
andyl
andyl
Why so complex? Just schedule svn update to run on a regular basis (cron job). If there are changes, it will pull them down. If there aren't, it'll do nothing. Finished. Why add complexity & points of failure when Subversion does this itself?
squeekjjy
squeekjjy
i dunno i just wanted to see if it was possible to work to what ALIENQuake asked for, tbh your right though, i actually thought maybe running an svn update when no updates are needed might just corrupt something or have conflicts but ive not used svn enough to know if it would or wouldent have issues, like i dont even know if the script i posted would work as i cant test it as im not on a linux machine atm.
ALIENQuake
ALIENQuake
It works ! Thx !  
andyl;120430Why so complex? Just schedule svn update to run on a regular basis (cron job). If there are changes, it will pull them down. If there aren't, it'll do nothing. Finished. Why add complexity & points of failure when Subversion does this itself?
  I need to run some other task, not only svn update.
squeekjjy
squeekjjy
any time, glad to help
andyl
andyl
ALIENQuake;120433I need to run some other task, not only svn update.
   OK, so write a script that does those other tasks as well as the svn update. But don't make it unnecessarily complicated - svn update is all you need for that portion of the script.

1-15 of 15

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.