Java tips and tricks from a lady trying to play with the boys...

Friday, August 22, 2008

Issues with CVSNT - Switching Between Unicode and Ascii

Problem: Using TortoiseCVS, a developer somehow checked in a bunch of SQL files as Unicode. I am nsure what exactly the developer did to do so, but likely it was caused by right clicking on a file when adding it to CVS and randomly selecting options from the "format" and "keywords" menus there. Who knows.

As the files were checked in and checked out of CVS by various developers, the files became more and more corrupted, merges were difficult, and the developers were unable to do their work without searching for random Unicode characters in the files and deleting them. In addition, CruiseControl stopped recognizing changes to files for updates.

Solution: A command-line interface needs to be used, I was unable to find a resolution with the CVSNT GUI interface.

  1. First, CVS.exe needs to be in your windows path. This was already done on our server because of CruiseControl and ANT using it.
  2. The command from a windows command line is:
    cvs update -kkv
  3. Once you have done this, you can use CVSNT to commit the file. If you do not commit, the changes will not be made. HOWEVER, you cannot commit using standard CVSNT means (TortoiseCVS). You need to right click on the file, select "Command" and enter the command commit -f
  4. The -f on the commit is absolutely necessary.
That's it!