简体   繁体   中英

Auto-commit directory tree to SVN with Java

I want autocommit directory tree with files to svn with java tool.

There are shell and bat script

bat

for /f "tokens=2*" %%i in ('svn status %1 ^| find "?"') do svn add "%%i"
for /f "tokens=2*" %%i in ('svn status %1 ^| find "!"') do svn delete "%%i"
svn commit -m "Automatic commit" %1

bash:

#!/bin/bash

echo "processing files to add..."
svn status | grep “^?” | sed -r ’s/^\?[ ]+//’ | xargs -r svn add

echo "processing files to delete..."
svn status | grep “^!” | sed -r ’s/^\![ ]+//’ | xargs -r svn delete

echo "processing commit..."
svn commit

They works, but I want java implementation for these scripts (ANT script, for example). Is there java implementation?

SVNKit is a pure Java SVN library. I'm sure using SVNKit you could re-implement your scripts in Java.

Be careful doing wildcard adds (or explicit, scripted adds), as they will bypass svn:ignore and global ignores.

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