[MERGE] walkdirs sort order

Robert Collins robertc at robertcollins.net
Fri Jun 16 11:02:35 BST 2006


This patch adds a sort key, and compare operator for paths that will
result in the same sort order that iter_entries_by_dirs and walkdirs
use.

The interesting thing to note here is that if we have the number of '/'
in a path prefixed to it, a normal bisect call can find a path in the
planned dirstate output trivially.

We might want to cache that value in the dirstate: i.e.
instead of 
====

====
for an empty path, use
====
0 
====

and instead of 
====
/foo/bar
====
use
====
2 /foo/bar
====

Dunno if this is cheaper than just counting the '/' at parse time.

Rob


-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: walkdirs-sort-order.patch
Type: text/x-patch
Size: 2585 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060616/7bcb9d7f/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060616/7bcb9d7f/attachment.pgp 


More information about the bazaar mailing list