/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

Merge bzr.dev to resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    lock,
28
28
    lockdir,
29
29
    repository,
 
30
    repository as _mod_repository,
30
31
    revision,
31
32
    revision as _mod_revision,
 
33
    static_tuple,
32
34
    symbol_versioning,
33
35
)
34
36
from bzrlib.branch import BranchReferenceFormat
903
905
        parents_provider = self._make_parents_provider(other_repository)
904
906
        return graph.Graph(parents_provider)
905
907
 
 
908
    @needs_read_lock
 
909
    def get_known_graph_ancestry(self, revision_ids):
 
910
        """Return the known graph for a set of revision ids and their ancestors.
 
911
        """
 
912
        st = static_tuple.StaticTuple
 
913
        revision_keys = [st(r_id).intern() for r_id in revision_ids]
 
914
        known_graph = self.revisions.get_known_graph_ancestry(revision_keys)
 
915
        return graph.GraphThunkIdsToKeys(known_graph)
 
916
 
906
917
    def gather_stats(self, revid=None, committers=None):
907
918
        """See Repository.gather_stats()."""
908
919
        path = self.bzrdir._path_for_remote_call(self._client)
1217
1228
            # state, so always add a lock here. If a caller passes us a locked
1218
1229
            # repository, they are responsible for unlocking it later.
1219
1230
            repository.lock_read()
 
1231
        self._check_fallback_repository(repository)
1220
1232
        self._fallback_repositories.append(repository)
1221
1233
        # If self._real_repository was parameterised already (e.g. because a
1222
1234
        # _real_branch had its get_stacked_on_url method called), then the
1227
1239
            if repository.bzrdir.root_transport.base not in fallback_locations:
1228
1240
                self._real_repository.add_fallback_repository(repository)
1229
1241
 
 
1242
    def _check_fallback_repository(self, repository):
 
1243
        """Check that this repository can fallback to repository safely.
 
1244
 
 
1245
        Raise an error if not.
 
1246
 
 
1247
        :param repository: A repository to fallback to.
 
1248
        """
 
1249
        return _mod_repository.InterRepository._assert_same_model(
 
1250
            self, repository)
 
1251
 
1230
1252
    def add_inventory(self, revid, inv, parents):
1231
1253
        self._ensure_real()
1232
1254
        return self._real_repository.add_inventory(revid, inv, parents)
1585
1607
        return self._real_repository.inventories
1586
1608
 
1587
1609
    @needs_write_lock
1588
 
    def pack(self, hint=None):
 
1610
    def pack(self, hint=None, clean_obsolete_packs=False):
1589
1611
        """Compress the data within the repository.
1590
1612
 
1591
1613
        This is not currently implemented within the smart server.
1592
1614
        """
1593
1615
        self._ensure_real()
1594
 
        return self._real_repository.pack(hint=hint)
 
1616
        return self._real_repository.pack(hint=hint, clean_obsolete_packs=clean_obsolete_packs)
1595
1617
 
1596
1618
    @property
1597
1619
    def revisions(self):