用户工具

站点工具


linux:svn

svn多个代码库管理

  • 定时发布:svn up -r 278 webapp回退到版本号,svn log -r {2021-07-30}:{2021-8-1}查看时间段或版本号之间的提交历史
lines=`svn up webapp|wc -l`
if [ $lines -gt 2 ] ; then
  echo "redeploy dev"
else
  echo "nothing change"
fi
  • 强制注释:hooks/pre-commit
LOGMSG=`$SVNLOOK log -t $TXN $REPOS | wc -m`
if [ "$LOGMSG" -lt 6 ]
then
 echo "you should comment your commit with 6+ chars or 3+ chinese chars" >&2
 exit 1
fi
  • 限制文件:
FILES=`$SVNLOOK changed -t $TXN $REPOS`
FORBIDS=`echo $FILES|egrep "A (.*.class|.*.tgz|.*.imp|.classpath|.project|bin/|node_modules|target/|.settings/|.apt_generated|.idea|.svn|.git|.factorypath|.vscode|.history)"`
if [ ! -z $FORBIDS ]; then
echo "FORBIDS=$FORBIDS" >&2
exit 1
fi
  • 切换路径
  ls -s svnrepos svnstore/name  #软连接即可
  svnserve -d svnstore  #支持多个svnrepos
  svn sw --relocate svn://ip:3690/path svn://host/path
  git svn clone svn://xlongwei.com/xlongwei/wxapp
  git svn rebase  //相当于svn up
  git svn dcommit //相当于svn commit,需要先更新
  • 数据迁移
svnadmin dump E:\SVNRepositories\repo1 E:\repo1.dump
svnadmin create /data/svnrepos/repo1
cd /data/svnrepos
svnadmin load repo1 < repo1.dump
cp E:\SVNRepositories\htpasswd /data/svnrepos/passwd
vi /data/svnrepos/repo1/conf/svnserve.conf
  password-db = ../../passwd
  authz-db = ../../authz
svnserve -d -r  /data/svnrepos/
  • svn:global-ignores,出现remains in conflict时,先revert回退
.apt_generated_tests
.apt_generated
.settings
.classpath
.gitignore
.project
.idea
.git
.metadata
.factorypath
.tern-project
.springBeans
.vscode
.hbuilderx
.history
target
AFC_log
bin
dist
temp
logs
node_modules
dependency-reduced-pom.xml
*.sh
*.tgz
*.iml
*.ipr
linux/svn.txt · 最后更改: 2021/08/09 09:25 由 admin