Hi,
See attached my patch for fixing issue #4395.
http://subversion.tigris.org/issues/show_bug.cgi?id=4395
[[[
Fix issue 4395 by not deleting the format and entries file when we
upgrade from an 1.7 working copy.
* subversion/libsvn_wc/upgrade.c
(wipe_obsolete_files): Add a boolean parameter remove_format_entries
declaring whether we should wipe format and entry files.
(svn_wc__wipe_postupgrade): Pass TRUE for remove_format_entries to
keep the old behavior for pre-1.7 working copies.
(svn_wc__upgrade_sdb): Pass FALSE for remove_format_entries to keep
the files when upgrading from an 1.7 (or newer) working copy.
]]]
All tests still pass after applying that change, but it seems the change itself
is not covered by any tests. Should I add a test case for it? If yes, how to
get/create 1.6 and 1.7 working copies within the test suite?
Best regards
Markus Schaber
CODESYS(r) a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions
3S-Smart Software Solutions GmbH
Dipl.-Inf. Markus Schaber | Product Development Core Technology
Memminger Str. 151 | 87439 Kempten | Germany
Tel. +49-831-54031-979 | Fax +49-831-54031-50
E-Mail: [email protected] | Web: http://www.codesys.com | CODESYS store:
http://store.codesys.com
CODESYS forum: http://forum.codesys.com
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade
register: Kempten HRB 6186 | Tax ID No.: DE 167014915
Index: subversion/libsvn_wc/upgrade.c
===================================================================
--- subversion/libsvn_wc/upgrade.c (revision 1603773)
+++ subversion/libsvn_wc/upgrade.c (working copy)
@@ -430,21 +430,24 @@
/* Wipe out all the obsolete files/dirs from the administrative area. */
static void
-wipe_obsolete_files(const char *wcroot_abspath, apr_pool_t *scratch_pool)
+wipe_obsolete_files(const char *wcroot_abspath, svn_boolean_t
remove_format_entries, apr_pool_t *scratch_pool)
{
/* Zap unused files. */
+ if (remove_format_entries)
+ {
+ svn_error_clear(svn_io_remove_file2(
+ svn_wc__adm_child(wcroot_abspath,
+ SVN_WC__ADM_FORMAT,
+ scratch_pool),
+ TRUE, scratch_pool));
+ svn_error_clear(svn_io_remove_file2(
+ svn_wc__adm_child(wcroot_abspath,
+ SVN_WC__ADM_ENTRIES,
+ scratch_pool),
+ TRUE, scratch_pool));
+ }
svn_error_clear(svn_io_remove_file2(
svn_wc__adm_child(wcroot_abspath,
- SVN_WC__ADM_FORMAT,
- scratch_pool),
- TRUE, scratch_pool));
- svn_error_clear(svn_io_remove_file2(
- svn_wc__adm_child(wcroot_abspath,
- SVN_WC__ADM_ENTRIES,
- scratch_pool),
- TRUE, scratch_pool));
- svn_error_clear(svn_io_remove_file2(
- svn_wc__adm_child(wcroot_abspath,
ADM_EMPTY_FILE,
scratch_pool),
TRUE, scratch_pool));
@@ -564,7 +567,7 @@
iterpool),
TRUE, NULL, NULL, iterpool));
else
- wipe_obsolete_files(dir_abspath, scratch_pool);
+ wipe_obsolete_files(dir_abspath, TRUE, scratch_pool);
if (delete_dir)
{
@@ -1977,7 +1980,7 @@
#endif
/* Zap anything that might be remaining or escaped our notice. */
- wipe_obsolete_files(wcroot_abspath, scratch_pool);
+ wipe_obsolete_files(wcroot_abspath, FALSE, scratch_pool);
return SVN_NO_ERROR;
}