sh SVN:同步,转储和清理

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh SVN:同步,转储和清理相关的知识,希望对你有一定的参考价值。

@echo off

echo We will create a local repository for you :-)
set /p repo="Local repository name: "

title %repo% (creating)
svnadmin create %repo%
echo Repository '%repo%' created.
echo [general] > %repo%\conf\svnserve.conf
echo anon-access = write >> %repo%\conf\svnserve.conf
echo Repository '%repo%' has been configured to be writable.
echo exit 0 > %repo%\hooks\pre-revprop-change.bat
echo Hook 'pre-revprop-change' created.

title %repo% (initializing sync)
echo.
set /p url="Source URL: "
set /p user="Source user, name: "
set /p pass="Source user, password: "

echo.
echo Initializing synchronization from '%url%' to '%~dp0%repo%' ...
svnsync init --allow-non-empty --source-username %user% --source-password %pass% file:///%~dp0%repo% %url%
pause

title %repo% (synchronizing)
echo.
echo Synchronizing from '%url%' to '%~dp0%repo%' ...
svnsync sync file:///%~dp0%repo% %url%

echo.
pause
@echo off

set /p repo="Local repository name: "
title %repo% (synchronizing)
svnsync sync --steal-lock file:///%~dp0%repo%

pause
@echo off

set /p repo="Local repository name: "
title %repo% (dumping)
svnadmin dump %repo% > %repo%.dump

pause
#!/bin/bash

repo=${1}.dump
filter=${1}_filter.txt

echo -n In progress...
grep --text 'Node-path' $repo | grep --ignore-case '_Output_files$' | sed 's/Node-path: //' > $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case 'ExportSTEP' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.bak$' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '/__Previews' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '/History' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case 'Project \{0,1\}Outputs' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case 'Project \{0,1\}Logs' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.[^\.]*Preview$' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.Dat$' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.Prj[^\.]*Structure$' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.PrjPcbVariants$' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.log$' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.lok$' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case 'Thumbs\.db$' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.svn' | sed 's/Node-path: //' >> $filter
#echo >> $filter
echo -n ..
grep --text 'Node-path' $repo | grep --ignore-case '\.out$' | sed 's/Node-path: //' >> $filter

echo
echo done
#!/bin/bash

repo=${1}.dump
filter=${1}_filter.txt

SAVEIFS=$IFS
IFS=$'\n'
svndumpfilter exclude `cat $filter` < $repo 2>&1 1> filtered_$repo | tee ${1}_dropped_nodes.txt
IFS=$SAVEIFS

以上是关于sh SVN:同步,转储和清理的主要内容,如果未能解决你的问题,请参考以下文章

sh 将项目从svn同步到git

Team Foundation Server - 使用 API 同步到 SVN

怎么解决svn清理失败且路径显示乱码问题

svn 删除项目

无法进行 SVN 转储 - 错误 E720002 和格式错误

手动更改后重新计算 SVN 转储中的校验和