Inconsistent iter_changes behavior

Aaron Bentley aaron.bentley at utoronto.ca
Thu Mar 15 20:59:58 GMT 2007


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

It appears that WorkingTree4.extras is broken.

I'm having trouble whittling this down to a smaller test case, so here's
how it goes:
$ bzr branch bzrtools-dev bzrtools-test
Branched 521 revision(s).
$ cd bzrtools-test/
$ bzr upgrade --dirstate-with-subtree
$ bzr split tests
$ bzr join --reference tests
$ bzr status
?   .bzr.backup/
 K  tests/ => tests+
- -D  tests/__init__.py
- -D  tests/blackbox.py
- -D  tests/clean_tree.py
- -D  tests/is_clean.py
- -D  tests/shelf_tests.py
- -D  tests/test_baz_import.py
- -D  tests/upstream_import.py

This is what you'd expect from it, because status doesn't recurse.

Now, I disable InterDirStateTree._iter_changes, so we use the
unoptimized path.

abentley at balrog:~/bzrplugins/inactive/bzrtools-test$ bzr status
?   .bzr.backup/
 K  tests/ => tests+
?   tests/__init__.py
?   tests/blackbox.py
?   tests/clean_tree.py
?   tests/is_clean.py
?   tests/shelf_tests.py
?   tests/test_baz_import.py
?   tests/upstream_import.py
- -D  tests/__init__.py
- -D  tests/blackbox.py
- -D  tests/clean_tree.py
- -D  tests/is_clean.py
- -D  tests/shelf_tests.py
- -D  tests/test_baz_import.py
- -D  tests/upstream_import.py
abentley at balrog:~/bzrplugins/inactive/bzrtools-test$

It appears that somehow, the "tests" subtree is being turned into an
InventoryDirectory.  Some dirstate operations will mask this problem,
because dirstate dynamically detects nested trees.  But WorkingTree4
doesn't have its own implementation of extras, so it uses
WorkingTree.extras, and that uses the inventory.  There are probably
other operations like this, too.

If we're going to dynamically detect subtrees, that should apply to the
inventory also.  Otherwise, we're going to get inconsistent behavior.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF+bPO0F+nu1YWqI0RAqBNAJ9gZ0JIuxvplAHzm19YShlGJMSm9wCdE1RQ
ize1S3CpIl6Xa1n3HW/32GA=
=J+79
-----END PGP SIGNATURE-----



More information about the bazaar mailing list