[MERGE] Turn record_iter_changes into a generator to emit file system hashes.

John Arbash Meinel john at arbash-meinel.com
Thu Mar 26 16:14:09 GMT 2009


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

This patch also includes your tree-reference fixes, so I'll just review
them both at once.

Robert Collins wrote:
> This makes record_iter_changes yield the results of sha1 calculations it
> does so that they can be cached.
> 
> -Rob
> 

+                        yield file_id, change[1][1], (entry.text_sha1,
stat_value)
                     except errors.ExistingContent:
                         # No content change against a carry_over parent
+                        # Perhaps this should also yield a fs hash update?


^- I think it should. The reason we got to this point was because the
dirstate/etc had a hash cache miss, so it seems reasonable to return it
so that we can try to update again.

...

+                    if (carry_over_possible and
+                        parent_entry.reference_revision ==
reference_revision):
+                        carried_over = True
+                    else:
+                        self._add_text_to_weave(change[0], [], heads, None)

^- I'm a bit curious how we handle tree-reference changes an carry-over,
but what you've written seems fine.


...

     def test_last_modified_revision_after_commit_link_unchanged_ric(self):
- -        # committing without changing a link does not change the last
modified.
- -        self.requireFeature(tests.SymlinkFeature)
+        # committing without changing a subtree does not change the
last modified.
         tree = self.make_branch_and_tree('.')
         os.symlink('target', 'link')

^- You removed the "requireFeature" for symlinks before calling
os.symlink. Obviously that just makes the test fail on windows. I assume
this was accidental.

...

=== modified file 'bzrlib/workingtree_4.py'
- --- bzrlib/workingtree_4.py	2009-03-20 04:16:24 +0000
+++ bzrlib/workingtree_4.py	2009-03-24 22:46:51 +0000
@@ -351,11 +351,9 @@
                     parent_ies[(dirname + '/' + name).strip('/')] =
inv_entry
                 elif kind == 'tree-reference':
                     if not self._repo_supports_tree_reference:
- -                        raise AssertionError(
- -                            "repository of %r "
- -                            "doesn't support tree references "
- -                            "required by entry %r"
- -                            % (self, name))
+                        raise errors.UnsupportedOperation(
+                            self._generate_inventory,
+                            self.branch.repository)
                     inv_entry.reference_revision = link_or_sha1 or None
                 elif kind != 'symlink':
                     raise AssertionError("unknown kind %r" % kind)


UnsupportedOperation(self._generate_inventory,...) doesn't seem quite
right. Is that correct?

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

iEYEARECAAYFAknLqdAACgkQJdeBCYSNAAPx4ACbBhniTxhuwFMKZiSy5aj8g3Pu
WKkAoIjK9uVYE8hVwYUq5EYsXDSyyzBc
=J+ey
-----END PGP SIGNATURE-----



More information about the bazaar mailing list