* subversion/libsvn_subr/io.c (svn_io_file_ungetc): New. Wrapper around apr_file_ungetc(). (svn_io_file_readline): Use svn_io_file_ungetc() for peeking char after we found '\r' instead of save position and seek back.
* subversion/tests/libsvn_subr/io-test.c (test_file_readline): New test for svn_io_file_readline(). (test_file_ungetc): New test for svn_io_file_ungetc(). (svn_test_descriptor_t): Add test_file_readline and test_file_ungetc.
When getting the default file permissions for a file created outside the system directory create the necessary temporary files in the given directory. This removes the disk IO to TMPDIR during the first commit made by mod_dav_svn and svnserve processes, all disk IO now happens in the repositories.
* subversion/libsvn_subr/io.c (get_default_file_perms): Create temporary files in given directory. (merge_default_file_perms): Add directory parameter. (svn_io_open_unique_file3): Pass directory.