26
26
from bzrlib.tree import RevisionTree
27
27
from bzrlib.errors import InvalidRevisionId
28
28
from bzrlib.testament import Testament
31
def needs_read_lock(unbound):
32
"""Decorate unbound to take out and release a read lock."""
33
def decorated(self, *args, **kwargs):
34
self.control_files.lock_read()
36
return unbound(self, *args, **kwargs)
38
self.control_files.unlock()
42
def needs_write_lock(unbound):
43
"""Decorate unbound to take out and release a write lock."""
44
def decorated(self, *args, **kwargs):
45
self.control_files.lock_write()
47
return unbound(self, *args, **kwargs)
49
self.control_files.unlock()
29
from bzrlib.decorators import needs_read_lock, needs_write_lock
53
33
class Repository(object):
34
"""Repository holding history for one or more branches.
36
The repository holds and retrieves historical information including
37
revisions and file history. It's normally accessed only by the Branch,
38
which views a particular line of development through that history.
40
The Repository builds on top of Stores and a Transport, which respectively
41
describe the disk data format and the way of accessing the (possibly
55
45
def __init__(self, transport, branch_format):
56
46
object.__init__(self)