Sie sind auf Seite 1von 3

11/28/12

windows - How do I automatically update a Subversion working copy? - Stack Overflow

How do I automatically update a Subversion working copy?

Does anybody know how I can automatically run s v nu p d a t e? If anybody has a script or something like that, could you show me an example?
windows svn scripting run

edited Oct 12 '11 at 18:25 Sander Rijken 12.1k 21 50

asked May 28 '09 at 8:39 Marko

How do you mean automatic? At what point should the update command be run automatically? Fredrik Mrk May 28 '09 at 8:43 What operating system will you be using to do the updates (Windows, Linux, MacOS, etc)? Elijah May 28 '09 at 8:43

I would not really recommend using an automatic update. Strange things can happen when you have changes that conflict with somebody else's changes, but your local files are then updated anyway. Benedikt May 28 '09 at 8:46

feedback

5 Answers
I use SVN Notifier which sits in the system tray and notifies me every time the repository changes. And I can highly recommend it. It means you only update when there's something to update! Alternatively you can set up a scheduled task/cron job to run s v nu p d a t e in the appropriate directory every hour/day/whatever.

EDIT: OK, take a look at this Microsoft article on setting up a scheduled task. You want a batch file called svnUpdate.bat or something which looks like this: c dC : / p a t h / t o / y o u r / w o r k i n g / c o p y s v nu p d a t e Get the scheduled task to run this as often as you like (once an hour seems sensible) Make sure you have the command line version of svn installed (I use SlikSvn) and available on your PATH (in a command window type s v n and ensure it says 'Type svn help...' or similar.
edited Sep 14 '09 at 14:32 answered May 28 '09 at 8:43 Mark Pim 4,675 2 21 44

Batch script will be the best solution Marko May 28 '09 at 8:50

Could you write full script for update, because I dont know what to run, and don't see anythig like update in may Installed folder. Marko May 28 '09 at 8:56 The command 'svn update' runs the svn program and tells it to update. These is no separate 'update' program. In a command prompt try typing svn update to check it works Mark Pim May 28 '09 at 8:58

stackoverflow.com/questions/919822/how-do-i-automatically-update-a-subversion-working-copy

1/3

11/28/12
feedback

windows - How do I automatically update a Subversion working copy? - Stack Overflow

I'm using TortoiseSVN. On the production server I have a scheduled task that runs the following batch file. C DC : \ P r o g r a mF i l e s \ T o r t o i s e S V N \ b i n \ S T A R TT o r t o i s e P r o c . e x e/ c o m m a n d : u p d a t e/ p a t h : " C : \ w w w \ M y R e p o \ "/ c l o s e o n e n d : 0 Hopefully this saves someone else some time!
answered Oct 15 '10 at 15:05 Matt 1,277 2 13 36 It did, thanks! James Lawruk Nov 19 '10 at 4:46 it worked, perfect solution Vinay Mar 7 at 11:00

Here's a +1 2 years after your answer. WernerCD Nov 8 at 14:34

feedback

@ e c h oo f f c l s e c h o= =I n i t i a t i n gs y s t e mi n s t a n c ev a r i a b l e s . . . e c h o .-S e t t i n gt h ev a r i a b l e s . . . : :H e r ey o un e e dt om a k es o m ec h a n g e st os u i ty o u rs y s t e m . s e tS O U R C E = C : \ s a u c e \ C U R R E N T s e tS V N = C : \ P r o g r a mF i l e s \ T o r t o i s e S V N \ b i n : :U n l e s sy o uw a n tt om o d i f yt h es c r i p t ,t h i si se n o u g h . e c h o .% S O U R C E % e c h o .% S V N % e c h o .+ +D o n es e t t i n gv a r i a b l e s . e c h o . e c h o= =U p d a t i n gs o u r c ef r o mS V N e c h o .-R u n n i n gu p d a t e . . . " % S V N % \ T o r t o i s e P r o c . e x e "/ c o m m a n d : u p d a t e/ p a t h : " % S O U R C E % "/ c l o s e o n e n d : 2 e c h o .+ +D o n e . e c h o .-C l e a n i n gu p . . . s e tS O U R C E = s e tS V N = e c h o .+ +D o n e . If you are using TortoiseSVN then the above batch script will suit fine. Otherwise you can just modify it to use whatever SVN client you are currently using. Just pop this in a .bat file and run it on demand.
edited May 28 '09 at 9:32 answered May 28 '09 at 9:04 varl 131 8

This is the relevant portion for a much larger "Build, destroy and deploy" script I wrote so there might be some comments or echos that you might prune. varl May 28 '09 at 9:06 I should copy this script in repository folder? Marko May 28 '09 at 9:09 This is good, but I need update changes at my project (not version of SVN). Marko May 28 '09 at 9:11

You can put this batch file on your desktop. Modify the SOURCE variable (I use C:\sauce\CURRENT) to

stackoverflow.com/questions/919822/how-do-i-automatically-update-a-subversion-working-copy

2/3

11/28/12

windows - How do I automatically update a Subversion working copy? - Stack Overflow


whatever directory you have your checked out trunk in. The SVN variable I set to the installation directory where TortoiseSVN (an SVN client) can be found. The script then runs the TortoiseSVN executable with a few parameters to tell Tortoise what directory to run an SVN update on. This will update your project with the newest files from the SVN repository. Not the application itself. varl May 28 '09 at 9:17 You can easily modify this script to run the update command from whatever SVN client you are currently using. varl May 28 '09 at 9:18 show 1 more comment feedback

Note: Once I know your operating system, I will be able to give you a more detailed answer. General Instructions 1. Never change anything in the local repository. 2. Read this link on how to use AT to schedule from the command line in windows. 3. Use the AT command to schedule the following command (assuming you have the command-line version of svn installed): svn update reporsitory_directory 4. Profit!
edited May 28 '09 at 8:52 answered May 28 '09 at 8:46 Elijah 5,330 1 20 53

Me should some way to run update by double click on one file. Marko May 28 '09 at 8:50 Then you could just create a windows shortcut that executes svn update repository_directory Elijah May 28 '09 at 8:58 Look, I don't have .exe file in my repository directory witch run update. I can give you list of all files in my repository folder. Marko May 28 '09 at 9:04 I managed. This script is very good. Tnx Marko May 28 '09 at 9:25

feedback

You can also download and use Commit-Monitor from http://code.google.com/p/commitmonitor/. It monitors SVN repositories for commits and notifies the user when it happens. It is in GNU GPL, ver 2.
answered Dec 21 '10 at 6:55 Vipin Hari 11 1 6 feedback

stackoverflow.com/questions/919822/how-do-i-automatically-update-a-subversion-working-copy

3/3

Das könnte Ihnen auch gefallen