[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[WIP] 'svn patch' should remove empty dirs

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Sun, 21 Feb 2010 23:02:27 +0100

Hi Stefan!

This patch is growing and growing and I'm worried that I'm heading off
in the wrong direction. Perhaps you can skim through the patch and tell
me if this is the right approach. You've said so earlier but all these
lines of code makes me nervous. I like small fixes, and this is starting
to look bloated.

A preliminary log msg (it's a WIP)
Make 'svn patch' able to remove empty.

* subversion/tests/cmdline/patch_tests.py
  (patch_remove_empty_dir): New.

* subversion/libsvn_client/patch.c
  (is_dir_empty): Checks if a dir is empty, taking missing nodes into
  (sort_compare_paths_by_depth): Compare func to use with
    svn_sort__hash(). Compares nr of '/' separators. Since the paths are
    canonicalized, it should work just fine.
  (collect_deleted_targets): If there is targets to be deleted, collect
    those targets and the targets no involving deletes in two arrays.
    TODO: We should condense the list of deleted dirs and be able to
    only delete the top-most parent.
  (apply_patches): TODO: We should remove the targets in
    delete_all_of_this. Or perhaps concatenate the two list into one?

Just a quick.
[ ] Yes, using APR forces you to a lot of boilerplate.
[ ] Hey there, you don't need to do all that, just ...

Hope I'm not asking to much,

Received on 2010-02-21 23:03:05 CET

This is an archived mail posted to the Subversion Dev mailing list.