Telling if two trees are different

John Arbash Meinel john at arbash-meinel.com
Thu Oct 23 22:00:03 BST 2008


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

James Westby wrote:
> On Thu, 2008-10-23 at 13:25 -0500, John Arbash Meinel wrote:
>> In general you should be able to do:
>>
>> for change in tree1.iter_changes(tree2):
>>   has_change = True
>>   break
>> else:
>>   has_change = False
> 
> Thanks John,
> 
> While reading your reply I remembered TreeDelta,
> 
>   has_change = tree1.changes_from(tree2).has_changed()
> 
> Where the intent is more obvious.
> 
> Is that going to be slower as it will generate the whole
> delta up front?
> 
> Thanks,
> 
> James
> 
> 

Yes.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkA5dMACgkQJdeBCYSNAAP2DQCgzHPOl00dkRbPxCrf7G/3LNBG
PCEAoNEDnQUAI2WJdzy41z3SY3eIrXX5
=KjWG
-----END PGP SIGNATURE-----



More information about the bazaar mailing list