3
"""Show paths used by bzr itself and push/pull locations for current branch
4
Written by Alexander Belchenko, 2006
5
License: Free for bzr users
8
from bzrlib.commands import Command, register_command
11
class cmd_show_paths(Command):
12
"""Show paths used by bzr itself and push/pull locations for current branch"""
19
from bzrlib.branch import Branch
20
from bzrlib.config import config_dir
21
from bzrlib.errors import NotBranchError, NoWorkingTree
22
from bzrlib import osutils
23
from bzrlib.plugin import DEFAULT_PLUGIN_PATH
24
from bzrlib import plugins
25
from bzrlib import trace
26
from bzrlib.workingtree import WorkingTree
30
print FORMAT % ('bzr executable', osutils.realpath(sys.argv[0]))
31
print FORMAT % ('bzrlib', osutils.realpath(bzrlib.__path__[0]))
33
print FORMAT % ('bzr config dir', osutils.realpath(config_dir()))
35
dirs = os.environ.get('BZR_PLUGIN_PATH', DEFAULT_PLUGIN_PATH).split(os.pathsep)
36
dirs.insert(0, os.path.dirname(plugins.__file__))
38
print FORMAT % ('bzr plugins dir', osutils.realpath(dirs[0]))
40
print FORMAT % ('bzr plugins dirs', osutils.realpath(dirs[0]))
42
print FORMAT % ('', osutils.realpath(dir_))
44
print FORMAT % ('.bzr.log', osutils.realpath(trace._bzr_log_file.name))
48
branch = WorkingTree.open_containing(u'.')[0].branch
50
branch = Branch.open_containing(u'.')[0]
52
pull_loc = branch.get_parent() or 'None'
53
print FORMAT % ('branch pull from', pull_loc)
55
push_loc = branch.get_push_location() or 'None'
56
print FORMAT % ('branch push to', push_loc)
57
except NotBranchError:
61
register_command(cmd_show_paths)