[merge] [#146176] fix Dirstate.set_state_from_inventory

John Arbash Meinel john at arbash-meinel.com
Tue Oct 9 18:41:59 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> The Dirstate.set_state_from_inventory routine updates the working tree
> in a dirstate.  It basically does a sorted merge of the inventory and
> the existing tree data.  However, the comparison was wrong (line
> 1923ff).  At best, this causes dirstate hashcache information to be
> discarded and re-shuffling of objects.  
> 
> (It's possible that it also causes more serious problems if the records
> are lost.  I can't think of a case off hand but might try some
> experiments on a branch without this merged, to see if I can make it
> fail.)
> 
> I believe this should substantially help performance on a status, diff
> or commit operation that follows an add or remove.
> 
> 
> 


> -            elif (new_entry_key[0].split('/') < current_old[0][0].split('/')
> -                  and new_entry_key[1:] < current_old[0][1:]):
> +            elif (new_dir_parts < current_old[0][0].split('/')
> +                  or (new_dirname == current_old[0][0]
> +                      and new_entry_key[1:] < current_old[0][1:])):

^- This check looks correct to me.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHC71nJdeBCYSNAAMRApuJAKCF6GHa1F9pH1JQe42PBhM2QpbTVwCfQuN/
GYa9U2pQp3I3rIIyEnBl+OE=
=KPaR
-----END PGP SIGNATURE-----



More information about the bazaar mailing list