/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: John Arbash Meinel
  • Date: 2006-06-16 21:05:03 UTC
  • mfrom: (1784 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1785.
  • Revision ID: john@arbash-meinel.com-20060616210503-3d6f8d1e9a6ca5b4
[merge] bzr.dev 1784, fix NEWS conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
846
846
        for dir in reversed(dirblock):
847
847
            if dir[2] == _directory:
848
848
                pending.append(dir)
 
849
 
 
850
 
 
851
def path_prefix_key(path):
 
852
    """Generate a prefix-order path key for path.
 
853
 
 
854
    This can be used to sort paths in the same way that walkdirs does.
 
855
    """
 
856
    return (dirname(path) , path)
 
857
 
 
858
 
 
859
def compare_paths_prefix_order(path_a, path_b):
 
860
    """Compare path_a and path_b to generate the same order walkdirs uses."""
 
861
    key_a = path_prefix_key(path_a)
 
862
    key_b = path_prefix_key(path_b)
 
863
    return cmp(key_a, key_b)