~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Johan Walles
  • Date: 2009-05-05 16:57:19 UTC
  • mto: This revision was merged to the branch mainline in revision 4343.
  • Revision ID: johan.walles@gmail.com-20090505165719-x2kib8xvablsfztu
Add unit test and fix for minimum_path_selection() vs directory names with
non-characters in them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
 
98
98
    :param paths: A container (and hence not None) of paths.
99
99
    :return: A set of paths sufficient to include everything in paths via
100
 
        is_inside_any, drawn from the paths parameter.
 
100
        is_inside, drawn from the paths parameter.
101
101
    """
102
102
    search_paths = []
103
 
    sorted_paths = list(paths)
104
 
    sorted_paths.sort()
 
103
 
 
104
    def sort_key(path):
 
105
        return path.split('/')
 
106
    sorted_paths = sorted(list(paths), key=sort_key)
 
107
 
105
108
    for path in sorted_paths:
106
109
        if len(search_paths) == 0:
107
110
            # Result is empty, add first path