~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/bzrdir.py

  • Committer: Vincent Ladeuil
  • Date: 2011-12-16 16:38:33 UTC
  • mto: This revision was merged to the branch mainline in revision 6387.
  • Revision ID: v.ladeuil+lp@free.fr-20111216163833-4igwmwi1dmxbbebw
Migrate add.maximum_file_size to the new config scheme

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Server-side bzrdir related request implmentations."""
18
18
 
19
 
from __future__ import absolute_import
20
19
 
21
 
from bzrlib import (
22
 
    bencode,
23
 
    branch,
24
 
    errors,
25
 
    repository,
26
 
    urlutils,
27
 
    )
 
20
from bzrlib import branch, errors, repository, urlutils
28
21
from bzrlib.bzrdir import (
29
22
    BzrDir,
30
23
    BzrDirFormat,
274
267
            self.transport_from_client_path(path))
275
268
        format = branch.network_format_registry.get(network_name)
276
269
        bzrdir.branch_format = format
277
 
        result = format.initialize(bzrdir, name="")
 
270
        result = format.initialize(bzrdir)
278
271
        rich_root, tree_ref, external_lookup = self._format_to_capabilities(
279
272
            result.repository._format)
280
273
        branch_format = result._format.network_name()
431
424
        return SuccessfulSmartServerResponse((), content)
432
425
 
433
426
 
434
 
class SmartServerBzrDirRequestGetBranches(SmartServerRequestBzrDir):
435
 
 
436
 
    def do_bzrdir_request(self):
437
 
        """Get the branches in a control directory.
438
 
        
439
 
        The body is a bencoded dictionary, with values similar to the return
440
 
        value of the open branch request.
441
 
        """
442
 
        branches = self._bzrdir.get_branches()
443
 
        ret = {}
444
 
        for name, b in branches.iteritems():
445
 
            if name is None:
446
 
                name = ""
447
 
            ret[name] = ("branch", b._format.network_name())
448
 
        return SuccessfulSmartServerResponse(
449
 
            ("success", ), bencode.bencode(ret))
450
 
 
451
 
 
452
427
class SmartServerRequestInitializeBzrDir(SmartServerRequest):
453
428
 
454
429
    def do(self, path):