Can I make Subversion + TortoiseSVN case-insensitive for Windows?

前端 未结 8 1351
北荒
北荒 2020-12-10 01:03

I\'ve been using Subversion for code control with TortoiseSVN to interface with the server for the past few months, and in general it\'s been going great! However, occasion

8条回答
  •  情深已故
    2020-12-10 01:50

    We had a similar problem and I found a better solution than the ones exposed here, so I'm sharing it now:

    • For commits done manualy, now TortoiseSVN fixes the case of the file names automatically: it renames the local files to match the case of the versioned files (just by opening the commit window in that path), so there should be no problem with that.

    • For automated commits you cannot use TortoiseSVN, as it requires you to manually confirm the commit (it opens the commit window with a specific message, but you still have to click ok). But if you directly use Subversion (svn) to make an automated commit, then you will have the case-sensitive issue on that commit, as Subversion is still case-sensitive...

    How to solve this for automated commits? Well, I tried a mixed approach: creating a batch file called FixCaseSensitiveFileNames.bat that you may call passing the path you want to fix before the commit, for example: call FixCaseSensitiveFileNames.bat C:\MyRepo. The batch file opens TortoiseSVN for a manual commit, and that automatically fixes the file names, but then it closes the commit window after a predefined pause, so you can continue with the automated commit with the case-sensitive file names already fixed. The pause is emulated with a local ping, and you can change the duration by changing the -n argument, which is the number of tries. If you don't make a long enough pause, it exist the risk to close the TortoiseSVN window before it makes its magic fix. Here it is the code of the batch file:

    @echo off
    REM *** This BAT uses TortoiseSVN to fix the case-sensitive names of the files in Subversion
    REM *** Call it before an automated commit. The Tortoise commit fixes this issue for manual commits,
    REM *** so the trick is opening the commit window and close it automatically after a pause (with ping).
    REM *** %1 = path to be fixed
    
    start TortoiseProc.exe /command:commit /path:"%1"
    ping localhost -n 10 >nul
    taskkill /im TortoiseProc.exe
    

    This totally solved the issue for our automated daily build process. The only problem I see is a window will open for a few seconds, which was not a problem for our daily build, but if that is a problem for you there could be workarounds too...

提交回复
热议问题