简体   繁体   中英

Command to check if svn remote revision is updated

I am very new to batch file.I am trying to write a batch file that will check in intervals if the svn remote's revision is updated. And if it finds the remote revision is newer, it will update the working copy. I have already tried svn diff and svn status . If somebody could help me with this problem I would be very grateful

I would back the comment by @LaurentH -- just run svn update and don't overcomplicate things unless you have a special case which you did not describe.

Anyway, if you are sure that you have a reason to check the repository before updating the working copy, try this approach:

  1. Create a working copy .
  2. Run the svn status --show-updates command (optionally with the --xml option).
  3. Parse the output of the command to determine whether the working copy is up to date.

When you run the svn status with the --show-updates option, it places an asterisk next to items that are out of date in your working copy.

Note that there is a chance that you could make use of TortoiseSVN Project Monitor or Commit Monitor that periodically polls the repositories and checks for the updates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM