~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Vincent Ladeuil
  • Date: 2011-04-28 12:26:34 UTC
  • mfrom: (5609.33.5 2.3)
  • mto: This revision was merged to the branch mainline in revision 5811.
  • Revision ID: v.ladeuil+lp@free.fr-20110428122634-rzbnq9u3aircltdo
Merge 2.3 into trunk resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    ui,
50
50
    urlutils,
51
51
    win32utils,
52
 
    workingtree_3,
 
52
    workingtree,
53
53
    workingtree_4,
54
54
    )
55
55
from bzrlib.repofmt import knitpack_repo
1252
1252
    def has_workingtree(self):
1253
1253
        """Tell if this bzrdir contains a working tree.
1254
1254
 
 
1255
        This will still raise an exception if the bzrdir has a workingtree that
 
1256
        is remote & inaccessible.
 
1257
 
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.
1257
1260
        """
1258
1261
        from bzrlib.workingtree import WorkingTreeFormat
1259
1262
        try:
1260
 
            WorkingTreeFormat.find_format_string(self)
 
1263
            WorkingTreeFormat.find_format(self)
1261
1264
        except errors.NoWorkingTree:
1262
1265
            return False
1263
1266
        return True
1883
1886
        else:
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',
2114
2117
    hidden=True,
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',
2122
2127
    hidden=True,
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',
2131
2136
    hidden=True,
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'
2136
2141
        ' bzr < 1.0.',
2137
2142
    branch_format='bzrlib.branch.BzrBranchFormat6',
2138
 
    tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
 
2143
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2139
2144
    hidden=True,
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,
2149
2154
    hidden=True,
2150
2155
    )
2155
2160
        'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2156
2161
        ,
2157
2162
    branch_format='bzrlib.branch.BzrBranchFormat6',
2158
 
    tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
 
2163
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2159
2164
    )
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. '
2165
2170
        ,
2166
2171
    branch_format='bzrlib.branch.BzrBranchFormat6',
2167
 
    tree_format='bzrlib.workingtree_4.WorkingTreeFormat4',
 
2172
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2168
2173
    hidden=True,
2169
2174
    experimental=True,
2170
2175
    )
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',
2177
2182
    hidden=True,
2178
2183
    )
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',
2186
2191
    hidden=True,
2187
2192
    )
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',
2194
2199
    hidden=True,
2195
2200
    )
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',
2203
2208
    hidden=True,
2204
2209
    )
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',
2211
2216
    hidden=True,
2212
2217
    )
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',
2218
2223
    )
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',
2225
2230
    )
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 '
2234
2239
        'before use.',
2235
2240
    branch_format='bzrlib.branch.BzrBranchFormat7',
2236
 
    tree_format='bzrlib.workingtree_4.WorkingTreeFormat6',
 
2241
    tree_format='bzrlib.workingtree.WorkingTreeFormat6',
2237
2242
    experimental=True,
2238
2243
    hidden=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 '
2250
2255
        'before use.',
2251
2256
    branch_format='bzrlib.branch.BzrBranchFormat7',
2252
 
    tree_format='bzrlib.workingtree_4.WorkingTreeFormat6',
 
2257
    tree_format='bzrlib.workingtree.WorkingTreeFormat6',
2253
2258
    experimental=True,
2254
2259
    hidden=True,
2255
2260
    alias=False,
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,
2271
2276
    )
2272
2277
 
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',
2279
2284
    alias=True,
2280
2285
    hidden=True,
2281
2286
    help='Same as 2a.')