65
65
def _show_location_info(repository, branch=None, working=None):
66
66
"""Show known locations for working, branch and repository."""
67
repository_path = repository.bzrdir.root_transport.base
68
repo_path = repository.bzrdir.root_transport.base
69
if working and branch:
70
working_path = working.bzrdir.root_transport.base
70
71
branch_path = branch.bzrdir.root_transport.base
71
if repository.bzrdir == branch.bzrdir:
73
work_path = working.bzrdir.root_transport.base
74
if working.bzrdir == branch.bzrdir:
75
if repository.is_shared():
76
# checkout in root of repository
77
print ' shared repository: %s' % repo_path
78
print ' repository checkout: %s' % (
79
_repo_relpath(repo_path, work_path))
80
elif branch.get_bound_location():
82
print ' branch root: %s' % branch_path
83
print ' bound to branch: %s' % (
84
branch.get_bound_location())
87
print ' branch root: %s' % branch_path
89
# lightweight checkout of standalone branch
90
print ' checkout root: %s' % work_path
91
print ' checkout of branch: %s' % branch_path
72
if working_path != branch_path:
73
# lightweight checkout
74
print ' light checkout root: %s' % working_path
75
if repository.is_shared():
76
# lightweight checkout of branch in shared repository
77
print ' shared repository: %s' % repository_path
78
print ' repository branch: %s' % (
79
_repo_relpath(repository_path, branch_path))
93
# repository with a branch inside root
94
if repository.is_shared():
95
print ' shared repository: %s' % repo_path
96
print ' repository branch: %s' % (
97
_repo_relpath(repo_path, branch_path))
99
print "this isn't possible, right? (1)"
81
# lightweight checkout of standalone branch
82
print ' checkout of branch: %s' % branch_path
83
elif repository.is_shared():
84
# branch with tree inside shared repository
85
print ' shared repository: %s' % repository_path
86
print ' repository checkout: %s' % (
87
_repo_relpath(repository_path, branch_path))
88
elif branch.get_bound_location():
90
print ' checkout root: %s' % working_path
91
print ' checkout of branch: %s' % branch.get_bound_location()
102
work_path = working.bzrdir.root_transport.base
103
if working.bzrdir != branch.bzrdir and (working.bzrdir !=
105
if osutils.is_inside(osutils.normalizepath(repo_path),
106
osutils.normalizepath(work_path)):
107
# lightweight checkout inside repository
108
print ' shared repository: %s' % repo_path
109
print ' repository checkout: %s' % (
110
_repo_relpath(repo_path, work_path))
111
print ' repository branch: %s' % (
112
_repo_relpath(repo_path, branch_path))
114
# lightweight checkout outside repository
115
print ' checkout root: %s' % work_path
116
print ' shared repository: %s' % repo_path
117
print ' repository branch: %s' % (
118
_repo_relpath(repo_path, branch_path))
120
# working tree inside branch or inside root
121
# of shared repository
122
print ' shared repository: %s' % repo_path
123
if working.bzrdir == branch.bzrdir:
124
print ' repository checkout: %s' % (
125
_repo_relpath(repo_path, work_path))
127
print ' repository branch: %s' % (
128
_repo_relpath(repo_path, branch_path))
130
# repository with branch
131
if repository.is_shared():
132
print ' shared repository: %s' % repo_path
133
print ' repository branch: %s' % (
134
_repo_relpath(repo_path, branch_path))
136
print "this isn't possible, right? (2)"
94
print ' branch root: %s' % working_path
96
# branch is part of shared repository
97
assert repository.is_shared()
98
branch_path = branch.bzrdir.root_transport.base
99
print ' shared repository: %s' % repository_path
100
print ' repository branch: %s' % (
101
_repo_relpath(repository_path, branch_path))
139
if repository.is_shared():
140
print ' shared repository: %s' % repo_path
142
print ' repository: %s' % repo_path
104
assert repository.is_shared()
105
print ' shared repository: %s' % repository_path
145
108
def _show_related_info(branch):