~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/bzrdir.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-15 17:02:13 UTC
  • mfrom: (4442 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4449.
  • Revision ID: john@arbash-meinel.com-20090615170213-3sgtjlvsr50v9r12
Merge bzr.dev 4442, in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Server-side bzrdir related request implmentations."""
18
18
 
19
19
 
20
 
from bzrlib import branch, errors, repository
 
20
from bzrlib import branch, errors, repository, urlutils
21
21
from bzrlib.bzrdir import (
22
22
    BzrDir,
23
23
    BzrDirFormat,
354
354
    def do(self, bzrdir_network_name, path, use_existing_dir, create_prefix,
355
355
        force_new_repo, stacked_on, stack_on_pwd, repo_format_name,
356
356
        make_working_trees, shared_repo):
357
 
        """Initialize a bzrdir at path as per BzrDirFormat.initialize_ex
 
357
        """Initialize a bzrdir at path as per
 
358
        BzrDirFormat.initialize_on_transport_ex.
 
359
 
 
360
        New in 1.16.  (Replaces BzrDirFormat.initialize_ex verb from 1.15).
358
361
 
359
362
        :return: return SuccessfulSmartServerResponse((repo_path, rich_root,
360
363
            tree_ref, external_lookup, repo_network_name,
407
410
            repo.unlock()
408
411
        final_stack = final_stack or ''
409
412
        final_stack_pwd = final_stack_pwd or ''
 
413
 
 
414
        # We want this to be relative to the bzrdir.
 
415
        if final_stack_pwd:
 
416
            final_stack_pwd = urlutils.relative_url(
 
417
                target_transport.base, final_stack_pwd)
 
418
 
 
419
        # Can't meaningfully return a root path.
 
420
        if final_stack.startswith('/'):
 
421
            client_path = self._root_client_path + final_stack[1:]
 
422
            final_stack = urlutils.relative_url(
 
423
                self._root_client_path, client_path)
 
424
            final_stack_pwd = '.'
 
425
 
410
426
        return SuccessfulSmartServerResponse((repo_path, rich_root, tree_ref,
411
427
            external_lookup, repo_name, repo_bzrdir_name,
412
428
            bzrdir._format.network_name(),