How do I automatically update a Subversion working copy?

前端 未结 5 1759
梦毁少年i
梦毁少年i 2020-12-02 08:20

Does anybody know how I can automatically run svn update? If anybody has a script or something like that, could you show me an example?

5条回答
  •  误落风尘
    2020-12-02 09:09

    @echo off
    
    cls
    echo == Initiating system instance variables...
    echo. -- Setting the variables...
    
    :: Here you need to make some changes to suit your system.
    set SOURCE=C:\sauce\CURRENT
    set SVN=C:\Program Files\TortoiseSVN\bin
    
    :: Unless you want to modify the script, this is enough.
    
    echo. %SOURCE%
    echo. %SVN%
    echo. ++ Done setting variables.
    echo.
    echo == Updating source from SVN
    echo. -- Running update...
    "%SVN%\TortoiseProc.exe" /command:update /path:"%SOURCE%" /closeonend:2
    echo. ++ Done.
    
    echo. -- Cleaning up...
    set SOURCE=
    set SVN=
    echo. ++ Done.
    

    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.

提交回复
热议问题