[PATCH] cleanup fails on missing .svn/tmp
From: Henner Zeller <h.zeller_at_acm.org>
Date: 2007-02-06 11:55:08 CET
Hi,
I tested what happens, if a .svn/tmp directory is missing:
---- $ rm -rf .svn/tmp $ svn update svn: Your .svn/tmp directory may be missing or corrupt; run 'svn cleanup' and try again svn: Can't open file '.svn/tmp/entries': No such file or directory $ svn cleanup svn: Can't open directory '.svn/tmp': No such file or directory --- cleanup fails, because it cannot remove the tmp-directory it is about to rebuild (adm_files.c [svn_wc__adm_cleanup_tmp_area()]). So it didn't work as advertised ;-) Just ignoring ENOENT-errors in svn_wc__adm_cleanup_tmp_area() wouldn't be correct, because we couldn't distinguish a ENOENT failures in the toplevel directory to remove and any recursively removed sub-files/dirs. Patch attached. -- proposed log message -- 'svn cleanup' should not fail on a missing .svn/tmp directory. It is removed and rebuild anyway so failing if it does not exist is counterproductive. * subversion/include/svn_io.h - added svn_io_remove_dir2(), deprecated svn_io_remove_dir() * subversion/libsvn_subr/io.c (svn_io_remove_dir2): modified old svn_io_remove_dir with ignore_enoent flag parameter (svn_io_remove_dir): implemented using svn_io_remove_dir2 * subversion/tests/cmdline/basic_tests.py (basic_cleanup): add regression: missing tmp-dir in cleanup * subversion/tests/cmdline/svntest/actions.py (remove_admin_tmp_dir): added * subversion/libsvn_fs_base/fs.c, subversion/libsvn_wc/adm_ops.c, subversion/libsvn_wc/adm_files.c, subversion/libsvn_wc/lock.c, subversion/libsvn_client/add.c, subversion/tests/svn_test_main.c, subversion/libsvn_repos/repos.c, subversion/libsvn_fs_fs/fs_fs.c, subversion/libsvn_fs_fs/fs.c: use new svn_io_remove_dir2() instead of deprecated svn_io_remove_dir() --- cheers, -henner
---------------------------------------------------------------------
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.