开发者

Auto-commit directory tree to SVN with Java

开发者 https://www.devze.com 2023-02-16 10:42 出处:网络
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\"

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 | 开发者_JS百科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.

0

精彩评论

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