Rev 2695: Allow specifying an access method to KnitVersionedFile. in http://people.ubuntu.com/~robertc/baz2.0/repository
Robert Collins
robertc at robertcollins.net
Thu Aug 2 08:36:30 BST 2007
At http://people.ubuntu.com/~robertc/baz2.0/repository
------------------------------------------------------------
revno: 2695
revision-id: robertc at robertcollins.net-20070802073628-3q69fgiaf5vqfcpu
parent: robertc at robertcollins.net-20070802073414-lk178jd62t489rb7
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Thu 2007-08-02 17:36:28 +1000
message:
Allow specifying an access method to KnitVersionedFile.
modified:
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py 2007-08-02 07:34:14 +0000
+++ b/bzrlib/knit.py 2007-08-02 07:36:28 +0000
@@ -365,7 +365,7 @@
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):
+ 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.
@@ -399,8 +399,11 @@
dir_mode=dir_mode)
else:
self._index = index
- _access = _KnitAccess(transport, relpath + DATA_SUFFIX, file_mode, dir_mode,
- ((create and not len(self)) and delay_create), create_parent_dir)
+ if access_method is None:
+ _access = _KnitAccess(transport, relpath + DATA_SUFFIX, file_mode, dir_mode,
+ ((create and not len(self)) and delay_create), create_parent_dir)
+ else:
+ _access = access_method
if create and not len(self) and not delay_create:
_access.create()
self._data = _KnitData(_access)
More information about the bazaar-commits
mailing list