Rev 3589: (jam) Repository.is_shared no longer takes a read lock in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Tue Jul 29 17:25:32 BST 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3589
revision-id:pqm at pqm.ubuntu.com-20080729162519-0m9oz0vbyhv14ypl
parent: pqm at pqm.ubuntu.com-20080729093250-b1g7zu2k1pj0mswe
parent: john at arbash-meinel.com-20080729155145-cg7pxcp1a0on2kx4
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-07-29 17:25:19 +0100
message:
(jam) Repository.is_shared no longer takes a read lock
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/repofmt/weaverepo.py presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
------------------------------------------------------------
revno: 3588.1.1
revision-id:john at arbash-meinel.com-20080729155145-cg7pxcp1a0on2kx4
parent: pqm at pqm.ubuntu.com-20080729093250-b1g7zu2k1pj0mswe
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: no_lock_for_is_shared
timestamp: Tue 2008-07-29 10:51:45 -0500
message:
Remove the needs_read_lock decorators for Repository.is_shared
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/repofmt/weaverepo.py presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'NEWS'
--- a/NEWS 2008-07-29 09:32:50 +0000
+++ b/NEWS 2008-07-29 15:51:45 +0000
@@ -71,6 +71,13 @@
* The ``put_on_disk`` and ``get_tar_item`` methods in
``InventoryEntry`` were deprecated. (Ian Clatworthy)
+ * ``Repository.is_shared`` doesn't take a read lock. It didn't
+ need one in the first place (nobody cached the value, and
+ ``RemoteRepository`` wasn't taking one either). This saves a round
+ trip when probing Pack repositories, as they read the ``pack-names``
+ file when locked. And during probe, locking the repo isn't very
+ useful. (John Arbash Meinel)
+
INTERNALS:
=== modified file 'bzrlib/repofmt/weaverepo.py'
--- a/bzrlib/repofmt/weaverepo.py 2008-07-28 09:12:28 +0000
+++ b/bzrlib/repofmt/weaverepo.py 2008-07-29 15:51:45 +0000
@@ -148,7 +148,6 @@
return self.inventories.add_lines((revision_id,), final_parents, lines,
check_content=check_content)[0]
- @needs_read_lock
def is_shared(self):
"""AllInOne repositories cannot be shared."""
return False
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2008-07-29 09:32:50 +0000
+++ b/bzrlib/repository.py 2008-07-29 15:51:45 +0000
@@ -1626,7 +1626,6 @@
else:
return self.get_inventory(revision_id)
- @needs_read_lock
def is_shared(self):
"""Return True if this repository is flagged as a shared repository."""
raise NotImplementedError(self.is_shared)
@@ -2006,7 +2005,6 @@
super(MetaDirRepository, self).__init__(_format, a_bzrdir, control_files)
self._transport = control_files._transport
- @needs_read_lock
def is_shared(self):
"""Return True if this repository is flagged as a shared repository."""
return self._transport.has('shared-storage')
More information about the bazaar-commits
mailing list