~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Robert Collins
  • Date: 2010-05-06 07:48:22 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506074822-0bsgf2j4h8jx0xkk
Added ``bzrlib.tests.matchers`` as a place to put matchers, along with
our first in-tree matcher. See the module docstring for details.
(Robert Collins)

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,
32
33
    static_tuple,
1239
1240
            # state, so always add a lock here. If a caller passes us a locked
1240
1241
            # repository, they are responsible for unlocking it later.
1241
1242
            repository.lock_read()
 
1243
        self._check_fallback_repository(repository)
1242
1244
        self._fallback_repositories.append(repository)
1243
1245
        # If self._real_repository was parameterised already (e.g. because a
1244
1246
        # _real_branch had its get_stacked_on_url method called), then the
1249
1251
            if repository.user_url not in fallback_locations:
1250
1252
                self._real_repository.add_fallback_repository(repository)
1251
1253
 
 
1254
    def _check_fallback_repository(self, repository):
 
1255
        """Check that this repository can fallback to repository safely.
 
1256
 
 
1257
        Raise an error if not.
 
1258
 
 
1259
        :param repository: A repository to fallback to.
 
1260
        """
 
1261
        return _mod_repository.InterRepository._assert_same_model(
 
1262
            self, repository)
 
1263
 
1252
1264
    def add_inventory(self, revid, inv, parents):
1253
1265
        self._ensure_real()
1254
1266
        return self._real_repository.add_inventory(revid, inv, parents)
1607
1619
        return self._real_repository.inventories
1608
1620
 
1609
1621
    @needs_write_lock
1610
 
    def pack(self, hint=None):
 
1622
    def pack(self, hint=None, clean_obsolete_packs=False):
1611
1623
        """Compress the data within the repository.
1612
1624
 
1613
1625
        This is not currently implemented within the smart server.
1614
1626
        """
1615
1627
        self._ensure_real()
1616
 
        return self._real_repository.pack(hint=hint)
 
1628
        return self._real_repository.pack(hint=hint, clean_obsolete_packs=clean_obsolete_packs)
1617
1629
 
1618
1630
    @property
1619
1631
    def revisions(self):