SVN on Windows实现文件名严格区分大小写

    Windows系统下文件名是不区分大小写的,但SVN里却是区分大小写的,在Windows里Commit文件,可能会造成版本库里有同名,但大小写不同的两个文件。
    解决方法是添加pre-commit脚本。如下引用是Windows下添加pre-commit脚本的方法,注意文中提到的check-case-insensitive.py已经过时,采用case-insensitive.py获取更好性能。

2009-04-30 Update:

http://www.visualsvn.com/support/topic/00019/

这里讲述了visualsvn server 内置hook的使用方法

实际上,visualsvn server有在windows的系统变量,所以以下语句对不同安装目录的visualsvn server有效

"%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" case-insensitive -t%2 %1


Get these files:

Then:

  • Install Subversion 1.2.3
  • Install Python 2.3.5
  • Unzip svn-win32-1.2.3_py.zip
  • Copy the unzipped directory svn-win32-1.2.3 to inside directory C:\Python23\Lib\site-packages\
  • Copy all DLLS from C:\Program Files\Subversion\bin\*.dll to C:\Python23\Lib\site-packages\svn-win32-1.2.3\python\libsvn\
  • Copy the file check-case-insensitive.py to directory c:\svnrepo\hooks\
  • Edit definition of SVNLIB_DIR in file check-case-insensitive.py to
    SVNLIB_DIR = r"C:/Python23/Lib/site-packages/svn-win32-1.2.3/python/"
  • Add/Create the file c:\svnrepo\hooks\pre-commit.bat containing these lines:
    c:\python23\python c:\svnrepo\hooks\check-case-insensitive.py %1 %2
        if errorlevel 1 goto :ERROR
        exit 0
        :ERROR
        echo Error found in commit 1>&2
        exit 1
        

Test by checking out a repo to two different directories

Create, add, and commit a file with an UPPERCASE name in first directory

Create, add, and commit a file with a lowercase name in second directory

The second commit will fail with this message:

Adding         sales\sale1.cpp
Transmitting file data .svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:
Case conflict: svnrepo/acme/trunk/sales/sale1.cpp
Error found in commit

Delete the UPPERCASE file with an "svn rm svn://.." command

The second commit can now go through

Thanks to xnooby for working this out and posting these instructions to the mailing list.

转载于:https://www.cnblogs.com/ukessi/archive/2009/01/31/1381637.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值