Rev 2882: * Removed previous deprecated ``basis_knit`` parameter to the in http://people.ubuntu.com/~robertc/baz2.0/knits

Robert Collins robertc at robertcollins.net
Thu Oct 4 04:07:38 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/knits

------------------------------------------------------------
revno: 2882
revision-id: robertc at robertcollins.net-20071004030526-25d0wxbbvqtjezau
parent: pqm at pqm.ubuntu.com-20071003232450-c831pepea3skddct
committer: Robert Collins <robertc at robertcollins.net>
branch nick: knits
timestamp: Thu 2007-10-04 13:05:26 +1000
message:
  * Removed previous deprecated ``basis_knit`` parameter to the
    ``KnitVersionedFile`` constructor.
  * Change lookup-before-access to fail-during-map-creation in knit text
    extraction reducing overall index operations during text extraction.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
=== modified file 'NEWS'
--- a/NEWS	2007-10-03 23:24:50 +0000
+++ b/NEWS	2007-10-04 03:05:26 +0000
@@ -131,6 +131,9 @@
      deprecated methods ``TestCase.capture`` and ``TestCase.run_bzr_captured``.
      (Martin Pool)
 
+   * Removed previous deprecated ``basis_knit`` parameter to the
+     ``KnitVersionedFile`` constructor. (Robert Collins)
+
    * Special purpose method ``TestCase.run_bzr_decode`` is moved to the test_non_ascii 
      class that needs it.
      (Martin Pool)

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2007-09-27 21:11:38 +0000
+++ b/bzrlib/knit.py	2007-10-04 03:05:26 +0000
@@ -421,9 +421,8 @@
     """
 
     def __init__(self, relpath, transport, file_mode=None, access_mode=None,
-                 factory=None, basis_knit=DEPRECATED_PARAMETER, delta=True,
-                 create=False, create_parent_dir=False, delay_create=False,
-                 dir_mode=None, index=None, access_method=None):
+        factory=None, delta=True, create=False, create_parent_dir=False,
+        delay_create=False, dir_mode=None, index=None, access_method=None):
         """Construct a knit at location specified by relpath.
         
         :param create: If not True, only open an existing knit.
@@ -434,10 +433,6 @@
             actually be created until the first data is stored.
         :param index: An index to use for the knit.
         """
-        if deprecated_passed(basis_knit):
-            warnings.warn("KnitVersionedFile.__(): The basis_knit parameter is"
-                 " deprecated as of bzr 0.9.",
-                 DeprecationWarning, stacklevel=2)
         if access_mode is None:
             access_mode = 'w'
         super(KnitVersionedFile, self).__init__(access_mode)
@@ -467,7 +462,7 @@
         self._data = _KnitData(_access)
 
     def __repr__(self):
-        return '%s(%s)' % (self.__class__.__name__, 
+        return '%s(%s)' % (self.__class__.__name__,
                            self.transport.abspath(self.filename))
     
     def _check_should_delta(self, first_parents):
@@ -988,9 +983,6 @@
         the requested versions and content_map contains the KnitContents.
         Both dicts take version_ids as their keys.
         """
-        for version_id in version_ids:
-            if not self.has_version(version_id):
-                raise RevisionNotPresent(version_id, self.filename)
         record_map = self._get_record_map(version_ids)
 
         text_map = {}
@@ -1441,7 +1433,10 @@
 
     def get_method(self, version_id):
         """Return compression method of specified version."""
-        options = self._cache[version_id][1]
+        try:
+            options = self._cache[version_id][1]
+        except KeyError:
+            raise RevisionNotPresent(version_id, self._filename)
         if 'fulltext' in options:
             return 'fulltext'
         else:
@@ -1680,7 +1675,10 @@
             return 'fulltext'
 
     def _get_node(self, version_id):
-        return list(self._get_entries(self._version_ids_to_keys([version_id])))[0]
+        try:
+            return list(self._get_entries(self._version_ids_to_keys([version_id])))[0]
+        except IndexError:
+            raise RevisionNotPresent(version_id, self)
 
     def get_options(self, version_id):
         """Return a string represention options.



More information about the bazaar-commits mailing list