开发者

Howto determine if an SVN working copy needs updating (from a script)?

开发者 https://www.devze.com 2023-01-04 08:07 出处:网络
I\'d like to determine from a batch file on Windows if a local SVN working copy needs to be updated from the server. On a unix-like machine, I would run \"svn status -u\" and count the \'*\'s. How do

I'd like to determine from a batch file on Windows if a local SVN working copy needs to be updated from the server. On a unix-like machine, I would run "svn status -u" and count the '*'s. How do I achieve the same thing in a batch file?

Background: I'm trying to determine if a dependency library is out-of-date since it takes a long time to re-build it and we only update it about once every 3 months. This is for an automated开发者_如何学编程 build process.


If I'm following you, maybe something like:

svn st -u | find "*"
if not "%errorlevel%"=="0" goto end

svn update

:end

find sets errorlevel to 0 if it successfully found "*".

EDIT: accidentally left off the "" around %errorlevel%.

0

精彩评论

暂无评论...
验证码 换一张
取 消