Rev 3844: (mbp) Deprecate LockableFiles._escape in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Nov 21 03:36:00 GMT 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3844
revision-id: pqm at pqm.ubuntu.com-20081121033557-q9noqdq5v3ulpg9a
parent: pqm at pqm.ubuntu.com-20081121012757-5oqu1dnj8kugnqqd
parent: mbp at sourcefrog.net-20081121025232-dvsfoc4cuookgckz
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-11-21 03:35:57 +0000
message:
  (mbp) Deprecate LockableFiles._escape
modified:
  bzrlib/lockable_files.py       control_files.py-20051111201905-bb88546e799d669f
  bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
  bzrlib/tests/test_permissions.py test_permissions.py-20051215004520-ccf475789c80e80c
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
    ------------------------------------------------------------
    revno: 3834.2.2
    revision-id: mbp at sourcefrog.net-20081121025232-dvsfoc4cuookgckz
    parent: mbp at sourcefrog.net-20081117032153-5al4ibc256whf5ut
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: controlfiles
    timestamp: Fri 2008-11-21 13:52:32 +1100
    message:
      Deprecated LockableFiles._escape
    modified:
      bzrlib/lockable_files.py       control_files.py-20051111201905-bb88546e799d669f
      bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
    ------------------------------------------------------------
    revno: 3834.2.1
    revision-id: mbp at sourcefrog.net-20081117032153-5al4ibc256whf5ut
    parent: pqm at pqm.ubuntu.com-20081112073322-dpai0jsluo3cvpf2
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: controlfiles
    timestamp: Mon 2008-11-17 14:21:53 +1100
    message:
      Remove dead exports
    modified:
      bzrlib/tests/test_permissions.py test_permissions.py-20051215004520-ccf475789c80e80c
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
      bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
=== modified file 'bzrlib/lockable_files.py'
--- a/bzrlib/lockable_files.py	2008-07-09 19:57:36 +0000
+++ b/bzrlib/lockable_files.py	2008-11-21 02:52:32 +0000
@@ -123,6 +123,7 @@
         self._lock.break_lock()
 
     def _escape(self, file_or_path):
+        """DEPRECATED: Do not use outside this class"""
         if not isinstance(file_or_path, basestring):
             file_or_path = '/'.join(file_or_path)
         if file_or_path == '':

=== modified file 'bzrlib/repofmt/weaverepo.py'
--- a/bzrlib/repofmt/weaverepo.py	2008-09-08 12:59:00 +0000
+++ b/bzrlib/repofmt/weaverepo.py	2008-11-21 02:52:32 +0000
@@ -38,6 +38,7 @@
     lockdir,
     osutils,
     revision as _mod_revision,
+    urlutils,
     versionedfile,
     weave,
     weavefile,
@@ -67,6 +68,13 @@
     def _serializer(self):
         return xml5.serializer_v5
 
+    def _escape(self, file_or_path):
+        if not isinstance(file_or_path, basestring):
+            file_or_path = '/'.join(file_or_path)
+        if file_or_path == '':
+            return u''
+        return urlutils.escape(osutils.safe_unicode(file_or_path))
+
     def __init__(self, _format, a_bzrdir):
         # we reuse one control files instance.
         dir_mode = a_bzrdir._get_dir_mode()
@@ -77,7 +85,7 @@
             # or entirely uncompressed is tidy, but breaks upgrade from 
             # some existing branches where there's a mixture; we probably 
             # still want the option to look for both.
-            relpath = a_bzrdir._control_files._escape(name)
+            relpath = self._escape(name)
             store = TextStore(a_bzrdir.transport.clone(relpath),
                               prefixed=prefixed, compressed=compressed,
                               dir_mode=dir_mode,

=== modified file 'bzrlib/tests/test_permissions.py'
--- a/bzrlib/tests/test_permissions.py	2008-09-01 06:16:07 +0000
+++ b/bzrlib/tests/test_permissions.py	2008-11-17 03:21:53 +0000
@@ -38,7 +38,6 @@
 
 from bzrlib.branch import Branch
 from bzrlib.bzrdir import BzrDir
-from bzrlib.lockable_files import LockableFiles, TransportLock
 from bzrlib.tests import TestCaseWithTransport, TestSkipped
 from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
 from bzrlib.transport import get_transport

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2008-10-28 10:43:48 +0000
+++ b/bzrlib/workingtree.py	2008-11-17 03:21:53 +0000
@@ -85,7 +85,7 @@
 from bzrlib import symbol_versioning
 from bzrlib.decorators import needs_read_lock, needs_write_lock
 from bzrlib.inventory import InventoryEntry, Inventory, ROOT_ID, TreeReference
-from bzrlib.lockable_files import LockableFiles, TransportLock
+from bzrlib.lockable_files import LockableFiles
 from bzrlib.lockdir import LockDir
 import bzrlib.mutabletree
 from bzrlib.mutabletree import needs_tree_write_lock

=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2008-10-12 15:38:00 +0000
+++ b/bzrlib/workingtree_4.py	2008-11-17 03:21:53 +0000
@@ -69,8 +69,6 @@
 from bzrlib import symbol_versioning
 from bzrlib.decorators import needs_read_lock, needs_write_lock
 from bzrlib.inventory import InventoryEntry, Inventory, ROOT_ID, entry_factory
-from bzrlib.lockable_files import LockableFiles, TransportLock
-from bzrlib.lockdir import LockDir
 import bzrlib.mutabletree
 from bzrlib.mutabletree import needs_tree_write_lock
 from bzrlib.osutils import (




More information about the bazaar-commits mailing list