Rev 2401: Remove LockableFiles.controlfilename. in http://sourcefrog.net/bzr/no-controlfiles

Martin Pool mbp at sourcefrog.net
Thu Apr 5 08:11:53 BST 2007


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

------------------------------------------------------------
revno: 2401
revision-id: mbp at sourcefrog.net-20070405071152-mqx7c8gad3eti1n4
parent: mbp at sourcefrog.net-20070405065423-krjdy38im10adim2
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: no-controlfiles
timestamp: Thu 2007-04-05 17:11:52 +1000
message:
  Remove LockableFiles.controlfilename.
modified:
  bzrlib/lockable_files.py       control_files.py-20051111201905-bb88546e799d669f
  bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
  bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
  bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
=== modified file 'bzrlib/lockable_files.py'
--- a/bzrlib/lockable_files.py	2007-04-05 06:54:23 +0000
+++ b/bzrlib/lockable_files.py	2007-04-05 07:11:52 +0000
@@ -140,10 +140,6 @@
         if not self._set_file_mode:
             self._file_mode = None
 
-    def controlfilename(self, file_or_path):
-        """Return location relative to branch."""
-        return self._transport.abspath(self._escape(file_or_path))
-
     @needs_read_lock
     def get(self, relpath):
         """Get a file as a bytestream."""

=== modified file 'bzrlib/tests/branch_implementations/test_branch.py'
--- a/bzrlib/tests/branch_implementations/test_branch.py	2007-03-30 02:36:36 +0000
+++ b/bzrlib/tests/branch_implementations/test_branch.py	2007-04-05 07:11:52 +0000
@@ -352,14 +352,8 @@
         # config file in the branch.
         branch.nick = "Aaron's branch"
         branch.nick = "Aaron's branch"
-        try:
-            controlfilename = branch.control_files.controlfilename
-        except AttributeError:
-            # remote branches don't have control_files
-            pass
-        else:
-            self.failUnless(
-                t.has(t.relpath(controlfilename("branch.conf"))))
+        self.failUnless(
+            branch._transport.has('branch.conf'))
         # Because the nick has been set explicitly, the nick is now always
         # "Aaron's branch", regardless of directory name.
         self.assertEqual(branch.nick, "Aaron's branch")

=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py	2007-03-11 20:34:48 +0000
+++ b/bzrlib/tests/test_transform.py	2007-04-05 07:11:52 +0000
@@ -53,8 +53,8 @@
         return transform, transform.root
 
     def test_existing_limbo(self):
-        limbo_name = urlutils.local_path_from_url(
-            self.wt._control_files.controlfilename('limbo'))
+        limbo_name = \
+            self.wt._control_files._transport.local_abspath('limbo')
         transform, root = self.get_transform()
         os.mkdir(pathjoin(limbo_name, 'hehe'))
         self.assertRaises(ImmortalLimbo, transform.apply)

=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py	2007-03-26 19:39:14 +0000
+++ b/bzrlib/transform.py	2007-04-05 07:11:52 +0000
@@ -91,14 +91,14 @@
         self._tree.lock_tree_write()
         try:
             control_files = self._tree._control_files
-            self._limbodir = urlutils.local_path_from_url(
-                control_files.controlfilename('limbo'))
+            self._limbodir = \
+                control_files._transport.local_abspath('limbo')
             try:
                 os.mkdir(self._limbodir)
             except OSError, e:
                 if e.errno == errno.EEXIST:
                     raise ExistingLimbo(self._limbodir)
-        except: 
+        except:
             self._tree.unlock()
             raise
 




More information about the bazaar-commits mailing list