Rev 2400: Remove deprecated LockableFiles.controlfile in http://sourcefrog.net/bzr/no-controlfiles

Martin Pool mbp at sourcefrog.net
Thu Apr 5 07:54:23 BST 2007


At http://sourcefrog.net/bzr/no-controlfiles

------------------------------------------------------------
revno: 2400
revision-id: mbp at sourcefrog.net-20070405065423-krjdy38im10adim2
parent: mbp at sourcefrog.net-20070405064650-d7bdzbnzekz24bg5
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: no-controlfiles
timestamp: Thu 2007-04-05 16:54:23 +1000
message:
  Remove deprecated LockableFiles.controlfile
modified:
  bzrlib/bundle/commands.py      __init__.py-20050617152058-1b6530d9ab85c11c
  bzrlib/lockable_files.py       control_files.py-20051111201905-bb88546e799d669f
=== modified file 'bzrlib/bundle/commands.py'
--- a/bzrlib/bundle/commands.py	2007-03-29 14:07:49 +0000
+++ b/bzrlib/bundle/commands.py	2007-04-05 06:54:23 +0000
@@ -66,7 +66,7 @@
 
         if not to:
             try:
-                to = b.controlfile('x-send-address', 'rb').read().strip('\n')
+                to = b._transport.get_bytes('x-send-address').strip('\n')
             except:
                 raise BzrCommandError('destination address is not known')
 

=== modified file 'bzrlib/lockable_files.py'
--- a/bzrlib/lockable_files.py	2007-04-05 06:25:29 +0000
+++ b/bzrlib/lockable_files.py	2007-04-05 06:54:23 +0000
@@ -144,34 +144,6 @@
         """Return location relative to branch."""
         return self._transport.abspath(self._escape(file_or_path))
 
-    @deprecated_method(zero_eight)
-    def controlfile(self, file_or_path, mode='r'):
-        """Open a control file for this branch.
-
-        There are two classes of file in a lockable directory: text
-        and binary.  binary files are untranslated byte streams.  Text
-        control files are stored with Unix newlines and in UTF-8, even
-        if the platform or locale defaults are different.
-
-        Such files are not openable in write mode : they are managed via
-        put and put_utf8 which atomically replace old versions using
-        atomicfile.
-        """
-
-        relpath = self._escape(file_or_path)
-        # TODO: codecs.open() buffers linewise, so it was overloaded with
-        # a much larger buffer, do we need to do the same for getreader/getwriter?
-        if mode == 'rb': 
-            return self.get(relpath)
-        elif mode == 'wb':
-            raise BzrError("Branch.controlfile(mode='wb') is not supported, use put[_utf8]")
-        elif mode == 'r':
-            return self.get_utf8(relpath)
-        elif mode == 'w':
-            raise BzrError("Branch.controlfile(mode='w') is not supported, use put[_utf8]")
-        else:
-            raise BzrError("invalid controlfile mode %r" % mode)
-
     @needs_read_lock
     def get(self, relpath):
         """Get a file as a bytestream."""




More information about the bazaar-commits mailing list