简体   繁体   中英

SVNKit : list of updated / added files in a working copy after update operation

I am trying to upload a bunch of property files placed in a directory to S3.

I have shared some details in https://stackoverflow.com/questions/16214798/s3-static-resource-update-on-regular-basis-using-java-or-shell-script .

As a solution, I am trying to do following:

  1. Commit property files to SVN reposity from anywhere.
  2. Checkout the property files to a Working copy on a local machine(LM).
  3. Use SVNKit to write an update task.
  4. Use S3 API to Upload only updated /added files in Working copy.

I have done Update and Upload to S3. But I am facing difficuly in getting list of added / updated files. Please help me out here.

You may set an ISVNEventHandler for the SvnUpdate and collect events on touched files in #handleEvent . However, this is not really a robust solution, IMO.

Instead:

  • make sure that you are on a clean revision before the update (alternatively use SvnStatusSummary to determine the minimum local revision present),
  • remember this revision number,
  • perform the SvnUpdate ,
  • check the log between the old and new revision, and finally
  • determine all touched files (there may be duplicates of course when changing a file a couple of times or redundant files when changing a file forth and back).

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