46
from bzrlib.branch import BranchReferenceFormat, BranchWriteLockResult
47
from bzrlib.decorators import needs_read_lock, needs_write_lock, only_raises
48
from bzrlib.errors import (
46
from breezy.branch import BranchReferenceFormat, BranchWriteLockResult
47
from breezy.decorators import needs_read_lock, needs_write_lock, only_raises
48
from breezy.errors import (
50
50
SmartProtocolError,
52
from bzrlib.i18n import gettext
53
from bzrlib.inventory import Inventory
54
from bzrlib.lockable_files import LockableFiles
55
from bzrlib.smart import client, vfs, repository as smart_repo
56
from bzrlib.smart.client import _SmartClient
57
from bzrlib.revision import NULL_REVISION
58
from bzrlib.revisiontree import InventoryRevisionTree
59
from bzrlib.repository import RepositoryWriteLockResult, _LazyListJoin
60
from bzrlib.serializer import format_registry as serializer_format_registry
61
from bzrlib.trace import mutter, note, warning, log_exception_quietly
62
from bzrlib.versionedfile import FulltextContentFactory
52
from breezy.i18n import gettext
53
from breezy.inventory import Inventory
54
from breezy.lockable_files import LockableFiles
55
from breezy.smart import client, vfs, repository as smart_repo
56
from breezy.smart.client import _SmartClient
57
from breezy.revision import NULL_REVISION
58
from breezy.revisiontree import InventoryRevisionTree
59
from breezy.repository import RepositoryWriteLockResult, _LazyListJoin
60
from breezy.serializer import format_registry as serializer_format_registry
61
from breezy.trace import mutter, note, warning, log_exception_quietly
62
from breezy.versionedfile import FulltextContentFactory
65
65
_DEFAULT_SEARCH_DEPTH = 100
108
# Note that RemoteBzrDirProber lives in bzrlib.bzrdir so bzrlib.remote
108
# Note that RemoteBzrDirProber lives in breezy.bzrdir so breezy.remote
109
109
# does not have to be imported unless a remote format is involved.
111
111
class RemoteBzrDirFormat(_mod_bzrdir.BzrDirMetaFormat1):
1050
1050
elif self._network_name:
1051
1051
network_name = self._network_name
1053
# Select the current bzrlib default and ask for that.
1053
# Select the current breezy default and ask for that.
1054
1054
reference_bzrdir_format = controldir.format_registry.get('default')()
1055
1055
reference_format = reference_bzrdir_format.repository_format
1056
1056
network_name = reference_format.network_name()
1408
1408
@needs_read_lock
1409
1409
def has_revision(self, revision_id):
1410
1410
"""True if this repository has a copy of the revision."""
1411
# Copy of bzrlib.repository.Repository.has_revision
1411
# Copy of breezy.repository.Repository.has_revision
1412
1412
return revision_id in self.has_revisions((revision_id,))
1414
1414
@needs_read_lock
1418
1418
:param revision_ids: An iterable of revision_ids.
1419
1419
:return: A set of the revision_ids that were present.
1421
# Copy of bzrlib.repository.Repository.has_revisions
1421
# Copy of breezy.repository.Repository.has_revisions
1422
1422
parent_map = self.get_parent_map(revision_ids)
1423
1423
result = set(parent_map)
1424
1424
if _mod_revision.NULL_REVISION in revision_ids:
2075
2075
This method is intended to be called after another repository instance
2076
2076
(such as one used by a smart server) has inserted data into the
2077
2077
repository. On all repositories this will work outside of write groups.
2078
Some repository formats (pack and newer for bzrlib native formats)
2078
Some repository formats (pack and newer for breezy native formats)
2079
2079
support refresh_data inside write groups. If called inside a write
2080
2080
group on a repository that does not support refreshing in a write group
2081
2081
IsInWriteGroupError will be raised.
2245
2245
yield identifier, bytes_iterator
2247
2247
def get_cached_parent_map(self, revision_ids):
2248
"""See bzrlib.CachingParentsProvider.get_cached_parent_map"""
2248
"""See breezy.CachingParentsProvider.get_cached_parent_map"""
2249
2249
return self._unstacked_provider.get_cached_parent_map(revision_ids)
2251
2251
def get_parent_map(self, revision_ids):
2252
"""See bzrlib.Graph.get_parent_map()."""
2252
"""See breezy.Graph.get_parent_map()."""
2253
2253
return self._make_parents_provider().get_parent_map(revision_ids)
2255
2255
def _get_parent_map_rpc(self, keys):
2403
2403
@needs_write_lock
2404
2404
def reconcile(self, other=None, thorough=False):
2405
from bzrlib.reconcile import RepoReconciler
2405
from breezy.reconcile import RepoReconciler
2406
2406
path = self.bzrdir._path_for_remote_call(self._client)
2408
2408
response, handler = self._call_expecting_body(
3147
3147
if self._custom_format:
3148
3148
network_name = self._custom_format.network_name()
3150
# Select the current bzrlib default and ask for that.
3150
# Select the current breezy default and ask for that.
3151
3151
reference_bzrdir_format = controldir.format_registry.get('default')()
3152
3152
reference_format = reference_bzrdir_format.get_branch_format()
3153
3153
self._custom_format = reference_format
3335
3335
self._real_branch.repository = self.repository
3337
3337
self._real_branch = None
3338
# Fill out expected attributes of branch for bzrlib API users.
3338
# Fill out expected attributes of branch for breezy API users.
3339
3339
self._clear_cached_state()
3340
3340
# TODO: deprecate self.base in favor of user_url
3341
3341
self.base = self.bzrdir.user_url
3521
3521
# We need the stacked_on_url to be visible both locally (to not query
3522
3522
# it repeatedly) and remotely (so smart verbs can get it server side)
3523
3523
# Without the following line,
3524
# bzrlib.tests.per_branch.test_create_clone.TestCreateClone
3524
# breezy.tests.per_branch.test_create_clone.TestCreateClone
3525
3525
# .test_create_clone_on_transport_stacked_hooks_get_stacked_branch
3526
3526
# fails for remote branches -- vila 2012-01-04
3527
3527
self.conf_store.save_changes()
3984
3984
It is a low-level object that considers config data to be name/value pairs
3985
3985
that may be associated with a section. Assigning meaning to the these
3986
values is done at higher levels like bzrlib.config.TreeConfig.
3986
values is done at higher levels like breezy.config.TreeConfig.
3989
3989
def get_option(self, name, section=None, default=None):