I was wondering if anyone here has experience writing this type of script, and if they could give me some pointers.
I would like to modify this script to confirm that the log file does not have a carriage return in EOL format, EOL format is CR LF on Windows and LF on Unix. When the user checks the code in Windows format. It no longer compiles on Unix. I know that this can be done on the client side, but I need this check to be done on the server side. To do this, I need to do the following:
1) Make sure the file I'm checking is not binary, I donβt know how to do it with svnlook, should I check the mime: type type? The Red Book does not indicate this explicitly or I must not have seen it.
2) I would like to run the dos2unix command to verify that the file has the correct EOL format. I would compare the output of the dos2unix command with the source file. If there is a difference between the two, I give an error message to the client and unregister.
I would like to receive your comments / feedback on this approach.
python svn dos2unix
Julien nephtali
source share