~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Ian Clatworthy
  • Date: 2009-05-18 10:54:13 UTC
  • mto: (4371.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4372.
  • Revision ID: ian.clatworthy@canonical.com-20090518105413-0xa2e47x8x77h9w9
add osutils.parent_directories() API

Show diffs side-by-side

added added

removed removed

Lines of Context:
867
867
    return pathjoin(*p)
868
868
 
869
869
 
 
870
def parent_directories(filename):
 
871
    """Return the list of parent directories, deepest first."""
 
872
    parents = []
 
873
    parts = splitpath(dirname(filename))
 
874
    while parts:
 
875
        parents.append(joinpath(parts))
 
876
        parts.pop()
 
877
    return parents
 
878
 
 
879
 
870
880
try:
871
881
    from bzrlib._chunks_to_lines_pyx import chunks_to_lines
872
882
except ImportError: