1252
1252
def has_workingtree(self):
1253
1253
"""Tell if this bzrdir contains a working tree.
1255
This will still raise an exception if the bzrdir has a workingtree that
1256
is remote & inaccessible.
1255
1258
Note: if you're going to open the working tree, you should just go
1256
1259
ahead and try, and not ask permission first.
1258
1261
from bzrlib.workingtree import WorkingTreeFormat
1260
WorkingTreeFormat.find_format_string(self)
1263
WorkingTreeFormat.find_format(self)
1261
1264
except errors.NoWorkingTree:
1884
1887
# TODO: conversions of Branch and Tree should be done by
1885
1888
# InterXFormat lookups
1886
if (isinstance(tree, workingtree_3.WorkingTree3) and
1889
if (isinstance(tree, workingtree.WorkingTree3) and
1887
1890
not isinstance(tree, workingtree_4.DirStateWorkingTree) and
1888
1891
isinstance(self.target_format.workingtree_format,
1889
1892
workingtree_4.DirStateWorkingTreeFormat)):
2110
2113
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
2111
2114
'Format using knits. Recommended for interoperation with bzr <= 0.14.',
2112
2115
branch_format='bzrlib.branch.BzrBranchFormat5',
2113
tree_format='bzrlib.workingtree_3.WorkingTreeFormat3',
2116
tree_format='bzrlib.workingtree.WorkingTreeFormat3',
2115
2118
deprecated=True)
2116
2119
register_metadir(controldir.format_registry, 'dirstate',
2118
2121
help='New in 0.15: Fast local operations. Compatible with bzr 0.8 and '
2119
2122
'above when accessed over the network.',
2120
2123
branch_format='bzrlib.branch.BzrBranchFormat5',
2121
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2124
# this uses bzrlib.workingtree.WorkingTreeFormat4 because importing
2125
# directly from workingtree_4 triggers a circular import.
2126
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2123
2128
deprecated=True)
2124
2129
register_metadir(controldir.format_registry, 'dirstate-tags',
2127
2132
'network operations. Additionally adds support for tags.'
2128
2133
' Incompatible with bzr < 0.15.',
2129
2134
branch_format='bzrlib.branch.BzrBranchFormat6',
2130
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2135
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2132
2137
deprecated=True)
2133
2138
register_metadir(controldir.format_registry, 'rich-root',
2135
2140
help='New in 1.0. Better handling of tree roots. Incompatible with'
2137
2142
branch_format='bzrlib.branch.BzrBranchFormat6',
2138
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2143
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2140
2145
deprecated=True)
2141
2146
register_metadir(controldir.format_registry, 'dirstate-with-subtree',
2144
2149
'network operations. Additionally adds support for versioning nested '
2145
2150
'bzr branches. Incompatible with bzr < 0.15.',
2146
2151
branch_format='bzrlib.branch.BzrBranchFormat6',
2147
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2152
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2148
2153
experimental=True,
2155
2160
'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2157
2162
branch_format='bzrlib.branch.BzrBranchFormat6',
2158
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2163
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2160
2165
register_metadir(controldir.format_registry, 'pack-0.92-subtree',
2161
2166
'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack3',
2164
2169
'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2166
2171
branch_format='bzrlib.branch.BzrBranchFormat6',
2167
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2172
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2169
2174
experimental=True,
2173
2178
help='New in 1.0: A variant of pack-0.92 that supports rich-root data '
2174
2179
'(needed for bzr-svn and bzr-git).',
2175
2180
branch_format='bzrlib.branch.BzrBranchFormat6',
2176
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2181
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2179
2184
register_metadir(controldir.format_registry, '1.6',
2182
2187
'(stacked) repository that should be used to access data that is '
2183
2188
'not present locally.',
2184
2189
branch_format='bzrlib.branch.BzrBranchFormat7',
2185
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2190
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2188
2193
register_metadir(controldir.format_registry, '1.6.1-rich-root',
2190
2195
help='A variant of 1.6 that supports rich-root data '
2191
2196
'(needed for bzr-svn and bzr-git).',
2192
2197
branch_format='bzrlib.branch.BzrBranchFormat7',
2193
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2198
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2196
2201
register_metadir(controldir.format_registry, '1.9',
2199
2204
'are smaller in size, have smarter caching and provide faster '
2200
2205
'performance for most operations.',
2201
2206
branch_format='bzrlib.branch.BzrBranchFormat7',
2202
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2207
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2205
2210
register_metadir(controldir.format_registry, '1.9-rich-root',
2207
2212
help='A variant of 1.9 that supports rich-root data '
2208
2213
'(needed for bzr-svn and bzr-git).',
2209
2214
branch_format='bzrlib.branch.BzrBranchFormat7',
2210
tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
2215
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2213
2218
register_metadir(controldir.format_registry, '1.14',
2214
2219
'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6',
2215
2220
help='A working-tree format that supports content filtering.',
2216
2221
branch_format='bzrlib.branch.BzrBranchFormat7',
2217
tree_format='bzrlib.workingtree_4.WorkingTreeFormat5',
2222
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
2219
2224
register_metadir(controldir.format_registry, '1.14-rich-root',
2220
2225
'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2221
2226
help='A variant of 1.14 that supports rich-root data '
2222
2227
'(needed for bzr-svn and bzr-git).',
2223
2228
branch_format='bzrlib.branch.BzrBranchFormat7',
2224
tree_format='bzrlib.workingtree_4.WorkingTreeFormat5',
2229
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
2226
2231
# The following un-numbered 'development' formats should always just be aliases.
2227
2232
register_metadir(controldir.format_registry, 'development-subtree',
2233
2238
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
2235
2240
branch_format='bzrlib.branch.BzrBranchFormat7',
2236
tree_format='bzrlib.workingtree_4.WorkingTreeFormat6',
2241
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
2237
2242
experimental=True,
2239
2244
alias=False, # Restore to being an alias when an actual development subtree format is added
2249
2254
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
2251
2256
branch_format='bzrlib.branch.BzrBranchFormat7',
2252
tree_format='bzrlib.workingtree_4.WorkingTreeFormat6',
2257
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
2253
2258
experimental=True,
2266
2271
# 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
2267
2272
# 'rich roots. Supported by bzr 1.16 and later.',
2268
2273
branch_format='bzrlib.branch.BzrBranchFormat7',
2269
tree_format='bzrlib.workingtree_4.WorkingTreeFormat6',
2274
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
2270
2275
experimental=False,
2275
2280
register_metadir(controldir.format_registry, 'default-rich-root',
2276
2281
'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a',
2277
2282
branch_format='bzrlib.branch.BzrBranchFormat7',
2278
tree_format='bzrlib.workingtree_4.WorkingTreeFormat6',
2283
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
2281
2286
help='Same as 2a.')