~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Martin Pool
  • Date: 2009-06-19 09:06:56 UTC
  • mfrom: (4463 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4464.
  • Revision ID: mbp@sourcefrog.net-20090619090656-d5weqeecyscv8kqp
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
2358
2358
    def set_branch_format(self, format):
2359
2359
        self._branch_format = format
2360
2360
 
2361
 
    def require_stacking(self, stack_on=None, possible_transports=None):
 
2361
    def require_stacking(self, stack_on=None, possible_transports=None,
 
2362
            _skip_repo=False):
2362
2363
        """We have a request to stack, try to ensure the formats support it.
2363
2364
 
2364
2365
        :param stack_on: If supplied, it is the URL to a branch that we want to
2402
2403
            target[:] = [target_branch, True, False]
2403
2404
            return target
2404
2405
 
2405
 
        if not (self.repository_format.supports_external_lookups):
 
2406
        if (not _skip_repo and
 
2407
                 not self.repository_format.supports_external_lookups):
2406
2408
            # We need to upgrade the Repository.
2407
2409
            target_branch, _, do_upgrade = get_target_branch()
2408
2410
            if target_branch is None:
3175
3177
        if not do_vfs:
3176
3178
            client = _SmartClient(client_medium)
3177
3179
            path = client.remote_path_from_transport(transport)
3178
 
            if client_medium._is_remote_before((1, 15)):
 
3180
            if client_medium._is_remote_before((1, 16)):
3179
3181
                do_vfs = True
3180
3182
        if do_vfs:
3181
3183
            # TODO: lookup the local format from a server hint.
3215
3217
            self._network_name = \
3216
3218
            BzrDirFormat.get_default_format().network_name()
3217
3219
        try:
3218
 
            response = client.call('BzrDirFormat.initialize_ex',
 
3220
            response = client.call('BzrDirFormat.initialize_ex_1.16',
3219
3221
                self.network_name(), path, *args)
3220
3222
        except errors.UnknownSmartMethod:
 
3223
            client._medium._remember_remote_is_before((1,16))
3221
3224
            local_dir_format = BzrDirMetaFormat1()
3222
3225
            self._supply_sub_formats_to(local_dir_format)
3223
3226
            return local_dir_format.initialize_on_transport_ex(transport,
3249
3252
                repo_bzr = bzrdir
3250
3253
            final_stack = response[8] or None
3251
3254
            final_stack_pwd = response[9] or None
 
3255
            if final_stack_pwd:
 
3256
                final_stack_pwd = urlutils.join(
 
3257
                    transport.base, final_stack_pwd)
3252
3258
            remote_repo = remote.RemoteRepository(repo_bzr, repo_format)
3253
3259
            if len(response) > 10:
3254
3260
                # Updated server verb that locks remotely.
3264
3270
        else:
3265
3271
            remote_repo = None
3266
3272
            policy = None
 
3273
        if require_stacking:
 
3274
            # The repo has already been created, but we need to make sure that
 
3275
            # we'll make a stackable branch.
 
3276
            bzrdir._format.require_stacking(_skip_repo=True)
3267
3277
        return remote_repo, bzrdir, require_stacking, policy
3268
3278
 
3269
3279
    def _open(self, transport):
3829
3839
    experimental=True,
3830
3840
    )
3831
3841
 
 
3842
format_registry.register_metadir('2a',
 
3843
    'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a',
 
3844
    help='First format for bzr 2.0 series.\n'
 
3845
        'Uses group-compress storage.\n'
 
3846
        'Provides rich roots which are a one-way transition.\n',
 
3847
        # 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
 
3848
        # 'rich roots. Supported by bzr 1.16 and later.',
 
3849
    branch_format='bzrlib.branch.BzrBranchFormat7',
 
3850
    tree_format='bzrlib.workingtree.WorkingTreeFormat6',
 
3851
    experimental=True,
 
3852
    )
 
3853
 
3832
3854
# The following format should be an alias for the rich root equivalent 
3833
3855
# of the default format
3834
3856
format_registry.register_metadir('default-rich-root',