~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-17 18:13:57 UTC
  • mfrom: (5268.7.29 transport-segments)
  • Revision ID: pqm@pqm.ubuntu.com-20110817181357-y5q5eth1hk8bl3om
(jelmer) Allow specifying the colocated branch to use in the branch URL,
 and retrieving the branch name using ControlDir._get_selected_branch.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
from bzrlib.lazy_import import lazy_import
20
18
lazy_import(globals(), """
21
19
import itertools
22
20
 
23
21
from bzrlib import (
24
 
    controldir,
 
22
    bzrdir,
25
23
    errors,
26
24
    knit as _mod_knit,
27
25
    lockable_files,
40
38
from bzrlib.repository import (
41
39
    InterRepository,
42
40
    IsInWriteGroupError,
43
 
    RepositoryFormatMetaDir,
 
41
    RepositoryFormat,
44
42
    )
45
43
from bzrlib.vf_repository import (
46
44
    InterSameDataRepository,
323
321
                                    than normal. I.e. during 'upgrade'.
324
322
        """
325
323
        if not _found:
326
 
            format = RepositoryFormatMetaDir.find_format(a_bzrdir)
 
324
            format = RepositoryFormat.find_format(a_bzrdir)
327
325
        if _override_transport is not None:
328
326
            repo_transport = _override_transport
329
327
        else:
369
367
    def __ne__(self, other):
370
368
        return self.__class__ is not other.__class__
371
369
 
372
 
    @classmethod
373
 
    def get_format_string(cls):
 
370
    def get_format_string(self):
374
371
        """See RepositoryFormat.get_format_string()."""
375
372
        return "Bazaar-NG Knit Repository Format 1"
376
373
 
405
402
        return xml7.serializer_v7
406
403
 
407
404
    def _get_matching_bzrdir(self):
408
 
        return controldir.format_registry.make_bzrdir('dirstate-with-subtree')
 
405
        return bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
409
406
 
410
407
    def _ignore_setting_bzrdir(self, format):
411
408
        pass
412
409
 
413
410
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
414
411
 
415
 
    @classmethod
416
 
    def get_format_string(cls):
 
412
    def get_format_string(self):
417
413
        """See RepositoryFormat.get_format_string()."""
418
414
        return "Bazaar Knit Repository Format 3 (bzr 0.15)\n"
419
415
 
447
443
        return xml6.serializer_v6
448
444
 
449
445
    def _get_matching_bzrdir(self):
450
 
        return controldir.format_registry.make_bzrdir('rich-root')
 
446
        return bzrdir.format_registry.make_bzrdir('rich-root')
451
447
 
452
448
    def _ignore_setting_bzrdir(self, format):
453
449
        pass
454
450
 
455
451
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
456
452
 
457
 
    @classmethod
458
 
    def get_format_string(cls):
 
453
    def get_format_string(self):
459
454
        """See RepositoryFormat.get_format_string()."""
460
455
        return 'Bazaar Knit Repository Format 4 (bzr 1.0)\n'
461
456
 
488
483
 
489
484
    @needs_read_lock
490
485
    def search_missing_revision_ids(self,
 
486
            revision_id=symbol_versioning.DEPRECATED_PARAMETER,
491
487
            find_ghosts=True, revision_ids=None, if_present_ids=None,
492
488
            limit=None):
493
489
        """See InterRepository.search_missing_revision_ids()."""
 
490
        if symbol_versioning.deprecated_passed(revision_id):
 
491
            symbol_versioning.warn(
 
492
                'search_missing_revision_ids(revision_id=...) was '
 
493
                'deprecated in 2.4.  Use revision_ids=[...] instead.',
 
494
                DeprecationWarning, stacklevel=2)
 
495
            if revision_ids is not None:
 
496
                raise AssertionError(
 
497
                    'revision_ids is mutually exclusive with revision_id')
 
498
            if revision_id is not None:
 
499
                revision_ids = [revision_id]
 
500
        del revision_id
494
501
        source_ids_set = self._present_source_revisions_for(
495
502
            revision_ids, if_present_ids)
496
503
        # source_ids is the worst possible case we may need to pull.