~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/bzrdir.py

  • Committer: INADA Naoki
  • Date: 2011-05-05 09:15:34 UTC
  • mto: (5830.3.3 i18n-msgfmt)
  • mto: This revision was merged to the branch mainline in revision 5873.
  • Revision ID: songofacandy@gmail.com-20110505091534-7sv835xpofwrmpt4
Add update-pot command to Makefile and tools/bzrgettext script that
extracts help text from bzr commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
22
22
    BzrDir,
23
23
    BzrDirFormat,
24
24
    BzrDirMetaFormat1,
 
25
    BzrProber,
 
26
    )
 
27
from bzrlib.controldir import (
25
28
    network_format_registry,
26
29
    )
27
30
from bzrlib.smart.request import (
44
47
            # clients that don't anticipate errors from this method.
45
48
            answer = 'no'
46
49
        else:
47
 
            default_format = BzrDirFormat.get_default_format()
48
 
            real_bzrdir = default_format.open(t, _found=True)
 
50
            bzr_prober = BzrProber()
49
51
            try:
50
 
                real_bzrdir._format.probe_transport(t)
 
52
                bzr_prober.probe_transport(t)
51
53
            except (errors.NotBranchError, errors.UnknownFormatError):
52
54
                answer = 'no'
53
55
            else:
110
112
        """Get the relative path for repository from current_transport."""
111
113
        # the relpath of the bzrdir in the found repository gives us the
112
114
        # path segments to pop-out.
113
 
        relpath = repository.bzrdir.root_transport.relpath(
 
115
        relpath = repository.user_transport.relpath(
114
116
            current_transport.base)
115
117
        if len(relpath):
116
118
            segments = ['..'] * len(relpath.split('/'))
179
181
 
180
182
        :param path: The path to the bzrdir.
181
183
        :param network_name: The network name of the branch type to create.
182
 
        :return: (ok, network_name)
 
184
        :return: ('ok', branch_format, repo_path, rich_root, tree_ref,
 
185
            external_lookup, repo_format)
183
186
        """
184
187
        bzrdir = BzrDir.open_from_transport(
185
188
            self.transport_from_client_path(path))
429
432
            # It is returned locked, but we need to do the lock to get the lock
430
433
            # token.
431
434
            repo.unlock()
432
 
            repo_lock_token = repo.lock_write() or ''
 
435
            repo_lock_token = repo.lock_write().repository_token or ''
433
436
            if repo_lock_token:
434
437
                repo.leave_lock_in_place()
435
438
            repo.unlock()