~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitpack_repo.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Knit-based pack repository formats."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
from bzrlib.lazy_import import lazy_import
20
22
lazy_import(globals(), """
21
23
from itertools import izip
22
24
import time
23
25
 
24
26
from bzrlib import (
25
 
    bzrdir,
 
27
    controldir,
26
28
    debug,
27
29
    errors,
28
30
    knit,
153
155
    index_class = GraphIndex
154
156
 
155
157
    def _get_matching_bzrdir(self):
156
 
        return bzrdir.format_registry.make_bzrdir('pack-0.92')
 
158
        return controldir.format_registry.make_bzrdir('pack-0.92')
157
159
 
158
160
    def _ignore_setting_bzrdir(self, format):
159
161
        pass
160
162
 
161
163
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
162
164
 
163
 
    def get_format_string(self):
 
165
    @classmethod
 
166
    def get_format_string(cls):
164
167
        """See RepositoryFormat.get_format_string()."""
165
168
        return "Bazaar pack repository format 1 (needs bzr 0.92)\n"
166
169
 
192
195
    index_class = GraphIndex
193
196
 
194
197
    def _get_matching_bzrdir(self):
195
 
        return bzrdir.format_registry.make_bzrdir(
 
198
        return controldir.format_registry.make_bzrdir(
196
199
            'pack-0.92-subtree')
197
200
 
198
201
    def _ignore_setting_bzrdir(self, format):
200
203
 
201
204
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
202
205
 
203
 
    def get_format_string(self):
 
206
    @classmethod
 
207
    def get_format_string(cls):
204
208
        """See RepositoryFormat.get_format_string()."""
205
209
        return "Bazaar pack repository format 1 with subtree support (needs bzr 0.92)\n"
206
210
 
230
234
    index_class = GraphIndex
231
235
 
232
236
    def _get_matching_bzrdir(self):
233
 
        return bzrdir.format_registry.make_bzrdir(
 
237
        return controldir.format_registry.make_bzrdir(
234
238
            'rich-root-pack')
235
239
 
236
240
    def _ignore_setting_bzrdir(self, format):
238
242
 
239
243
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
240
244
 
241
 
    def get_format_string(self):
 
245
    @classmethod
 
246
    def get_format_string(cls):
242
247
        """See RepositoryFormat.get_format_string()."""
243
248
        return ("Bazaar pack repository format 1 with rich root"
244
249
                " (needs bzr 1.0)\n")
269
274
        return xml5.serializer_v5
270
275
 
271
276
    def _get_matching_bzrdir(self):
272
 
        return bzrdir.format_registry.make_bzrdir('1.6')
 
277
        return controldir.format_registry.make_bzrdir('1.6')
273
278
 
274
279
    def _ignore_setting_bzrdir(self, format):
275
280
        pass
276
281
 
277
282
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
278
283
 
279
 
    def get_format_string(self):
 
284
    @classmethod
 
285
    def get_format_string(cls):
280
286
        """See RepositoryFormat.get_format_string()."""
281
287
        return "Bazaar RepositoryFormatKnitPack5 (bzr 1.6)\n"
282
288
 
308
314
        return xml6.serializer_v6
309
315
 
310
316
    def _get_matching_bzrdir(self):
311
 
        return bzrdir.format_registry.make_bzrdir(
 
317
        return controldir.format_registry.make_bzrdir(
312
318
            '1.6.1-rich-root')
313
319
 
314
320
    def _ignore_setting_bzrdir(self, format):
316
322
 
317
323
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
318
324
 
319
 
    def get_format_string(self):
 
325
    @classmethod
 
326
    def get_format_string(cls):
320
327
        """See RepositoryFormat.get_format_string()."""
321
328
        return "Bazaar RepositoryFormatKnitPack5RichRoot (bzr 1.6.1)\n"
322
329
 
352
359
        return xml7.serializer_v7
353
360
 
354
361
    def _get_matching_bzrdir(self):
355
 
        matching = bzrdir.format_registry.make_bzrdir(
 
362
        matching = controldir.format_registry.make_bzrdir(
356
363
            '1.6.1-rich-root')
357
364
        matching.repository_format = self
358
365
        return matching
362
369
 
363
370
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
364
371
 
365
 
    def get_format_string(self):
 
372
    @classmethod
 
373
    def get_format_string(cls):
366
374
        """See RepositoryFormat.get_format_string()."""
367
375
        return "Bazaar RepositoryFormatKnitPack5RichRoot (bzr 1.6)\n"
368
376
 
393
401
        return xml5.serializer_v5
394
402
 
395
403
    def _get_matching_bzrdir(self):
396
 
        return bzrdir.format_registry.make_bzrdir('1.9')
 
404
        return controldir.format_registry.make_bzrdir('1.9')
397
405
 
398
406
    def _ignore_setting_bzrdir(self, format):
399
407
        pass
400
408
 
401
409
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
402
410
 
403
 
    def get_format_string(self):
 
411
    @classmethod
 
412
    def get_format_string(cls):
404
413
        """See RepositoryFormat.get_format_string()."""
405
414
        return "Bazaar RepositoryFormatKnitPack6 (bzr 1.9)\n"
406
415
 
429
438
        return xml6.serializer_v6
430
439
 
431
440
    def _get_matching_bzrdir(self):
432
 
        return bzrdir.format_registry.make_bzrdir(
 
441
        return controldir.format_registry.make_bzrdir(
433
442
            '1.9-rich-root')
434
443
 
435
444
    def _ignore_setting_bzrdir(self, format):
437
446
 
438
447
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
439
448
 
440
 
    def get_format_string(self):
 
449
    @classmethod
 
450
    def get_format_string(cls):
441
451
        """See RepositoryFormat.get_format_string()."""
442
452
        return "Bazaar RepositoryFormatKnitPack6RichRoot (bzr 1.9)\n"
443
453
 
469
479
        return xml7.serializer_v7
470
480
 
471
481
    def _get_matching_bzrdir(self):
472
 
        return bzrdir.format_registry.make_bzrdir(
 
482
        return controldir.format_registry.make_bzrdir(
473
483
            'development5-subtree')
474
484
 
475
485
    def _ignore_setting_bzrdir(self, format):
477
487
 
478
488
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
479
489
 
480
 
    def get_format_string(self):
 
490
    @classmethod
 
491
    def get_format_string(cls):
481
492
        """See RepositoryFormat.get_format_string()."""
482
493
        return ("Bazaar development format 2 with subtree support "
483
494
            "(needs bzr.dev from before 1.8)\n")