[MERGE] compare_trees with all unknowns

John Arbash Meinel john at arbash-meinel.com
Mon Jul 24 14:02:05 BST 2006


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

Robert Collins wrote:
> On Fri, 2006-07-21 at 10:18 -0500, John Arbash Meinel wrote:
>> === modified file bzrlib/delta.py
>> --- bzrlib/delta.py
>> +++ bzrlib/delta.py
>> @@ -184,6 +184,10 @@
>>                  trees = trees + tuple(extra_trees)
>>              specific_file_ids =
>> tree.find_ids_across_trees(specific_files, 
>>                  trees, require_versioned=require_versioned)
>> +            if specific_files and not specific_file_ids:
>> +                # All files are unversioned, so just return an empty
>> delta
>> +                # _compare_trees would think we want a complete delta
>> +                return TreeDelta()
>>              return _compare_trees(old_tree, new_tree, want_unchanged,
>>                                    specific_file_ids)
>>          finally:
> 
> 
> I'm not sure this is right.
> 
> If we go back to the earlier discussion about tree deltas, having the
> delta show differences between unknowns would be useful. However, this
> will require _compare_trees to allow comparison of file paths too, as
> well as file ids.
> 
> In terms of user experience, I'm thinking that 
> 
> $ bzr st foo
> unknown:
>   foo
> 
> is what we want to see. 
> 
> Rob

This is what we see. The problem is that without this fix,
_compare_trees does a full delta, and doing:

$ bzr st foo
added:
  a
  b
  c
renamed:
  d => e
unknown:
  foo

But if you did:
$ bzr st a foo
added:
  a
unknown:
  foo

It is a bug that supplying a list to 'compare_trees' gets filtered to
only things with file ids, and then when it is passed to
'_compare_trees' an empty list means do everything.

Ultimately, we probably want to update 'compare_trees' (or its
equivalent) so that we can include unknowns, conflicts, etc.

But until we get there, I would at least like this bug fixed.

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

iD8DBQFExMTNJdeBCYSNAAMRAlZ2AJ4nZPsljT78WgH1ADzzG2efuhdvxwCgxkNl
PF5nIEzwSi7+/KlZ2EkvuUE=
=G3nc
-----END PGP SIGNATURE-----




More information about the bazaar mailing list