[merge] [#146176] fix Dirstate.set_state_from_inventory
John Arbash Meinel
john at arbash-meinel.com
Fri Oct 19 20:07:40 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
>> By the way, you probably actually want
>> _cmp_path_by_dirblock
>>
>> Which means you won't actually have to split the string. It hasn't been exposed
>> into dirstate.py yet, but is used by the bisect* routines.
>
> Thanks for suggesting that. The thing is, we get one of the paths
> (current_old) already split up from the dirstate. Would it be worth
> joining it just to call _cmp_path_by_dirblock?
>
> elif (cmp_by_dirs(new_dirname, current_old[0][0]) < 0
> or (new_dirname == current_old[0][0]
> and new_entry_key[1:] < current_old[0][1:])):
>
I would guess that doing "'/'.join(current_old[0][:2])" is faster than doing
new_dirname, new_basename = osutils.split(new_path_utf8)
However, you have to do the split anyway, because you need it when building up
the key.
So I take back my earlier statement. The _cmp_path_by_dirblock would be faster,
but you've already had to do all the work to split things up.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHGQB8JdeBCYSNAAMRAtoFAJ41F4vJa+POYEh6b5Q8aG2WP84bpACffXmK
vDYnvM+mg8l9GJqUv/Kr06I=
=7Atn
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list