[merge] more LockableFiles deprecations and misc cleanups

Martin Pool mbp at canonical.com
Tue May 13 02:13:55 BST 2008


As NEWS says:

+  API BREAKS:
+
+    * ``Branch.abspath`` is deprecated; use the Tree or Transport 
+      instead.
+      (Martin Pool)
+
+    * ``LockableFiles.put_utf8``, ``put_bytes`` and ``controlfilename``
+      are now deprecated in favor of using Transport operations.
+      (Martin Pool)
+
+    * Branch, Repository, Tree and BzrDir should expose a Transport as an
+      attribute if they have one, rather than having it indirectly accessible
+      as ``.control_files._transport``.  This doesn't add a requirement
+      to support a Transport in cases where it was not needed before;
+      it just simplifies the way it is reached.
+      (Martin Pool)
+
+    * ``WorkingTreeFormat2.stub_initialize_remote`` is now private.
+      (Martin Pool) 
+

This also kills a private method _initialize_control_files that was
apparently never used.  There is still some duplication across classes
of "create initial control files and lock" logic.

FakeControlFilesAndTransport provides both interfaces so gets a better
name.

I can see one nit looking over this but I'd like to send it
provisional review anyhow:

-        # self._transport used to point to the directory containing the
-        # control directory, but was not used - now it's just the transport
-        # for the branch control files.  mbp 20070212
         self._base = self.bzrdir.transport.clone('..').base
+        # self.base = self.bzrdir.root_transport.base

The code that is still there, setting _base, seems a bit wonky, but I
didn't finish changing it.  What this wants is to get the user-visible name
of the branch (the directory containing .bzr) and it should ask the bzrdir
for this.

The changes to use transport.put_bytes() etc are somewhat overlapping
with my other patch to get the permissions from the BzrDir rather than
LockableFiles, but I thought they would be easier to review separately.

One of the main things that still uses control_files is get_text_store
and co; I'm not going to touch them because I think that will overlap
with Robert's changes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20080512-controlfiles.diff
Type: text/x-diff
Size: 79515 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080513/66b3bff5/attachment-0001.bin 


More information about the bazaar mailing list