~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/bzrdir.py

  • Committer: Robert Collins
  • Date: 2010-02-27 12:27:33 UTC
  • mto: This revision was merged to the branch mainline in revision 5061.
  • Revision ID: robertc@robertcollins.net-20100227122733-2o3me3fkk3pk36ns
``bzrlib.branchbuilder.BranchBuilder.build_snapshot`` now accepts a
``message_callback`` in the same way that commit does. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    BzrDir,
23
23
    BzrDirFormat,
24
24
    BzrDirMetaFormat1,
25
 
    BzrProber,
26
 
    )
27
 
from bzrlib.controldir import (
28
25
    network_format_registry,
29
26
    )
30
27
from bzrlib.smart.request import (
47
44
            # clients that don't anticipate errors from this method.
48
45
            answer = 'no'
49
46
        else:
50
 
            bzr_prober = BzrProber()
 
47
            default_format = BzrDirFormat.get_default_format()
 
48
            real_bzrdir = default_format.open(t, _found=True)
51
49
            try:
52
 
                bzr_prober.probe_transport(t)
 
50
                real_bzrdir._format.probe_transport(t)
53
51
            except (errors.NotBranchError, errors.UnknownFormatError):
54
52
                answer = 'no'
55
53
            else:
112
110
        """Get the relative path for repository from current_transport."""
113
111
        # the relpath of the bzrdir in the found repository gives us the
114
112
        # path segments to pop-out.
115
 
        relpath = repository.user_transport.relpath(
 
113
        relpath = repository.bzrdir.root_transport.relpath(
116
114
            current_transport.base)
117
115
        if len(relpath):
118
116
            segments = ['..'] * len(relpath.split('/'))
431
429
            # It is returned locked, but we need to do the lock to get the lock
432
430
            # token.
433
431
            repo.unlock()
434
 
            repo_lock_token = repo.lock_write().repository_token or ''
 
432
            repo_lock_token = repo.lock_write() or ''
435
433
            if repo_lock_token:
436
434
                repo.leave_lock_in_place()
437
435
            repo.unlock()