On Tue, 2010-04-13, s...@apache.org wrote: > Author: stsp > Date: Tue Apr 13 19:45:17 2010 > New Revision: 933767 > > URL: http://svn.apache.org/viewvc?rev=933767&view=rev > Log: > On the svn-patch-improvements branch, revamp handling of deleted directories. > > While not originally intended, this is almost a complete rewrite of the > logic handling directory deletions. Compared to the previous implementation: > - It does not modify lists in place while iterating them. > - It does not add empty directories which can be deleted as 'fake' patch > targets, but deletes them directly, and skips targets which were deleted > together with the parent directories. > - It splits the overall task into more steps. > > * subversion/libsvn_client/patch.c > (patch_target_t): New field PARENT_DIR_DELETED, to trigger special > processing of targets which are within deleted directories. > (init_patch_target): Initialise PARENT_DIR_DELETED. > (is_dir_empty): Rename to ... > (check_dir_empty): ... this, and in addition to the list of deleted > targets, accept a list of directories we know will be removed. > (add_target_to_hash_keyed_by_parent_dir, sort_compare_path_component_count, > condense_deleted_targets): Remove.
> (push_if_unique): New helper function, needed because we do not use > a hash table anymore to ensure path uniqueness. Why not use a hash table? It looks like doing so would have good effects - avoiding the need for push_if_unique() and the two sub-loops in check_dir_empty(). - Julian > (delete_empty_dirs): New function, which determines which directories will > be empty after patching, deletes them, and marks any targets which are > children of the deleted directories. > (install_patched_target): Skip targets which had their parent dir removed > from above them. > (apply_patches): Call delete_empty_dirs() instead of the removed > condense_deleted_targets(). Do not notify about targets which were > deleted together with their parent directories. > > * subversion/tests/cmdline/patch_tests.py > (patch_remove_empty_dir): Rename to ... > (patch_remove_empty_dirs): .. this, and adjust expected output because > notification order has changed. > (test_list): Track renamed function. > > Review by: dannas > > Modified: > > subversion/branches/svn-patch-improvements/subversion/libsvn_client/patch.c > > subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py