[MERGE] Update to bzr.dev.
Martin Pool
mbp at canonical.com
Wed Jun 18 03:05:02 BST 2008
picking up in versionedfile.py:
+ if type(key) != tuple:
+ import pdb;pdb.set_trace()
+ if not revision.is_reserved_id(key[-1]):
again; we should just grep for pdb; raise TypeError would be appropriate
here.
+ def get_parent_map(self, keys):
+ """See VersionedFiles.get_parent_map"""
+ # We create a new provider because a fallback may have been added.
+ # If we make fallbacks private we can update a stack list and avoid
+ # object creation thrashing.
+ self._providers = self._providers[:1] + self.fallback_versionedfiles
+ result = _StackedParentsProvider(self._providers).get_parent_map(keys)
+ for key, parents in result.iteritems():
+ if parents == ():
+ result[key] = (revision.NULL_REVISION,)
return result
I don't understand why _providers is an attribute rather than just being a
local to this method. Instead have an attribute holding the
DictParentsProvider created in the constructor. I don't think this is
actually buggy but there is potential for aliasing bugs.
=== modified file 'bzrlib/weave.py'
@@ -989,9 +942,13 @@
sio = StringIO()
write_weave_v5(self, sio)
sio.seek(0)
- self._transport.put_file(self._weave_name + WeaveFile.WEAVE_SUFFIX,
- sio,
- self._filemode)
+ bytes = sio.getvalue()
+ path = self._weave_name + WeaveFile.WEAVE_SUFFIX
+ try:
+ self._transport.put_bytes(path, bytes, self._filemode)
+ except errors.NoSuchFile:
+ self._transport.mkdir(dirname(path))
+ self._transport.put_bytes(path, bytes, self._filemode)
@staticmethod
def get_suffixes():
I'm a bit curious why you had to change this but it's not wrong.
=== modified file 'bzrlib/weave_commands.py'
=== modified file 'bzrlib/workingtree.py'
=== modified file 'bzrlib/workingtree.py'
no comments for these files
=== modified file 'bzrlib/workingtree_4.py'
+ return list(self.iter_files_bytes([(file_id, None)]))[0][1]
This pattern occurs a couple of times and kind of sticks out. Maybe we
should either have a specific interface for getting the text for just one
file, or deprecate entirely the methods that need to call it...
=== modified file 'NEWS'
--- NEWS 2008-06-11 04:20:56 +0000
+++ NEWS 2008-06-11 07:22:00 +0000
@@ -33,6 +33,10 @@
INTERNALS:
+ * New ``versionedfile.KeyMapper`` interface to abstract out the access to
+ underyling .knit/.kndx etc files in repositories with partitioned
+ storage. (Robert Collins)
+
spelled 'underlying'
I think now we've covered every non-test file.
--
Martin
More information about the bazaar
mailing list