/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
0.17.9 by Robert Collins
Initial stab at repository format support.
1
# groupcompress, a bzr plugin providing improved disk utilisation
2
# Copyright (C) 2008 Canonical Limited.
3
# 
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License version 2 as published
6
# by the Free Software Foundation.
7
# 
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
# 
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
16
# 
17
18
"""Repostory formats using B+Tree indices and groupcompress compression."""
19
20
import md5
21
import time
22
23
from bzrlib import debug, errors, pack, repository
0.17.21 by Robert Collins
Update groupcompress to bzrlib 1.10.
24
from bzrlib.btree_index import (
25
    BTreeBuilder,
26
    BTreeGraphIndex,
27
    )
0.17.9 by Robert Collins
Initial stab at repository format support.
28
from bzrlib.index import GraphIndex, GraphIndexBuilder
29
from bzrlib.repository import InterPackRepo
30
from bzrlib.plugins.groupcompress.groupcompress import (
31
    _GCGraphIndex,
32
    GroupCompressVersionedFiles,
33
    )
34
from bzrlib.osutils import rand_chars
35
from bzrlib.repofmt.pack_repo import (
36
    Pack,
37
    NewPack,
38
    KnitPackRepository,
39
    RepositoryPackCollection,
0.17.21 by Robert Collins
Update groupcompress to bzrlib 1.10.
40
    RepositoryFormatPackDevelopment2,
41
    RepositoryFormatPackDevelopment2Subtree,
0.17.9 by Robert Collins
Initial stab at repository format support.
42
    RepositoryFormatKnitPack1,
43
    RepositoryFormatKnitPack3,
44
    RepositoryFormatKnitPack4,
45
    Packer,
46
    ReconcilePacker,
47
    OptimisingPacker,
48
    )
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
49
try:
50
    from bzrlib.repofmt.pack_repo import (
0.17.26 by Robert Collins
Working better --gc-plain-chk.
51
    CHKInventoryRepository,
0.21.1 by John Arbash Meinel
Start basing the groupcompress chk formats on the dev5 formats.
52
    RepositoryFormatPackDevelopment5,
53
    RepositoryFormatPackDevelopment5Hash16,
0.21.3 by John Arbash Meinel
Start putting together a GroupCompress format that is built on dev5
54
    RepositoryFormatPackDevelopment5Hash255,
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
55
    )
56
    chk_support = True
57
except ImportError:
58
    chk_support = False
0.17.9 by Robert Collins
Initial stab at repository format support.
59
from bzrlib import ui
60
61
62
def open_pack(self):
0.17.22 by Robert Collins
really get gc working with 1.10
63
    return self._pack_collection.pack_factory(self._pack_collection,
64
        upload_suffix=self.suffix,
0.17.9 by Robert Collins
Initial stab at repository format support.
65
        file_mode=self._pack_collection.repo.bzrdir._get_file_mode())
66
67
68
Packer.open_pack = open_pack
69
70
71
class GCPack(NewPack):
72
0.17.22 by Robert Collins
really get gc working with 1.10
73
    def __init__(self, pack_collection, upload_suffix='', file_mode=None):
0.17.9 by Robert Collins
Initial stab at repository format support.
74
        """Create a NewPack instance.
75
76
        :param upload_transport: A writable transport for the pack to be
77
            incrementally uploaded to.
78
        :param index_transport: A writable transport for the pack's indices to
79
            be written to when the pack is finished.
80
        :param pack_transport: A writable transport for the pack to be renamed
81
            to when the upload is complete. This *must* be the same as
82
            upload_transport.clone('../packs').
83
        :param upload_suffix: An optional suffix to be given to any temporary
84
            files created during the pack creation. e.g '.autopack'
85
        :param file_mode: An optional file mode to create the new files with.
86
        """
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
87
        # replaced from bzr.dev to:
88
        # - change inventory reference list length to 1
89
        # - change texts reference lists to 1
90
        # TODO: patch this to be parameterised upstream
91
        
0.17.9 by Robert Collins
Initial stab at repository format support.
92
        # The relative locations of the packs are constrained, but all are
93
        # passed in because the caller has them, so as to avoid object churn.
0.17.22 by Robert Collins
really get gc working with 1.10
94
        index_builder_class = pack_collection._index_builder_class
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
95
        if chk_support:
96
            # from brisbane-core
97
            if pack_collection.chk_index is not None:
98
                chk_index = index_builder_class(reference_lists=0)
99
            else:
100
                chk_index = None
101
            Pack.__init__(self,
102
                # Revisions: parents list, no text compression.
103
                index_builder_class(reference_lists=1),
104
                # Inventory: We want to map compression only, but currently the
105
                # knit code hasn't been updated enough to understand that, so we
106
                # have a regular 2-list index giving parents and compression
107
                # source.
108
                index_builder_class(reference_lists=1),
109
                # Texts: compression and per file graph, for all fileids - so two
110
                # reference lists and two elements in the key tuple.
111
                index_builder_class(reference_lists=1, key_elements=2),
112
                # Signatures: Just blobs to store, no compression, no parents
113
                # listing.
114
                index_builder_class(reference_lists=0),
115
                # CHK based storage - just blobs, no compression or parents.
116
                chk_index=chk_index
117
                )
118
        else:
119
            # from bzr.dev
120
            Pack.__init__(self,
121
                # Revisions: parents list, no text compression.
122
                index_builder_class(reference_lists=1),
123
                # Inventory: compressed, with graph for compatibility with other
124
                # existing bzrlib code.
125
                index_builder_class(reference_lists=1),
126
                # Texts: per file graph:
127
                index_builder_class(reference_lists=1, key_elements=2),
128
                # Signatures: Just blobs to store, no compression, no parents
129
                # listing.
130
                index_builder_class(reference_lists=0),
131
                )
0.17.22 by Robert Collins
really get gc working with 1.10
132
        self._pack_collection = pack_collection
133
        # When we make readonly indices, we need this.
134
        self.index_class = pack_collection._index_class
0.17.9 by Robert Collins
Initial stab at repository format support.
135
        # where should the new pack be opened
0.17.22 by Robert Collins
really get gc working with 1.10
136
        self.upload_transport = pack_collection._upload_transport
0.17.9 by Robert Collins
Initial stab at repository format support.
137
        # where are indices written out to
0.17.22 by Robert Collins
really get gc working with 1.10
138
        self.index_transport = pack_collection._index_transport
0.17.9 by Robert Collins
Initial stab at repository format support.
139
        # where is the pack renamed to when it is finished?
0.17.22 by Robert Collins
really get gc working with 1.10
140
        self.pack_transport = pack_collection._pack_transport
0.17.9 by Robert Collins
Initial stab at repository format support.
141
        # What file mode to upload the pack and indices with.
142
        self._file_mode = file_mode
143
        # tracks the content written to the .pack file.
144
        self._hash = md5.new()
145
        # a four-tuple with the length in bytes of the indices, once the pack
146
        # is finalised. (rev, inv, text, sigs)
147
        self.index_sizes = None
148
        # How much data to cache when writing packs. Note that this is not
149
        # synchronised with reads, because it's not in the transport layer, so
150
        # is not safe unless the client knows it won't be reading from the pack
151
        # under creation.
152
        self._cache_limit = 0
153
        # the temporary pack file name.
154
        self.random_name = rand_chars(20) + upload_suffix
155
        # when was this pack started ?
156
        self.start_time = time.time()
157
        # open an output stream for the data added to the pack.
158
        self.write_stream = self.upload_transport.open_write_stream(
159
            self.random_name, mode=self._file_mode)
160
        if 'pack' in debug.debug_flags:
161
            mutter('%s: create_pack: pack stream open: %s%s t+%6.3fs',
162
                time.ctime(), self.upload_transport.base, self.random_name,
163
                time.time() - self.start_time)
164
        # A list of byte sequences to be written to the new pack, and the 
165
        # aggregate size of them.  Stored as a list rather than separate 
166
        # variables so that the _write_data closure below can update them.
167
        self._buffer = [[], 0]
168
        # create a callable for adding data 
169
        #
170
        # robertc says- this is a closure rather than a method on the object
171
        # so that the variables are locals, and faster than accessing object
172
        # members.
173
        def _write_data(bytes, flush=False, _buffer=self._buffer,
174
            _write=self.write_stream.write, _update=self._hash.update):
175
            _buffer[0].append(bytes)
176
            _buffer[1] += len(bytes)
177
            # buffer cap
178
            if _buffer[1] > self._cache_limit or flush:
179
                bytes = ''.join(_buffer[0])
180
                _write(bytes)
181
                _update(bytes)
182
                _buffer[:] = [[], 0]
183
        # expose this on self, for the occasion when clients want to add data.
184
        self._write_data = _write_data
185
        # a pack writer object to serialise pack records.
186
        self._writer = pack.ContainerWriter(self._write_data)
187
        self._writer.begin()
188
        # what state is the pack in? (open, finished, aborted)
189
        self._state = 'open'
190
191
192
RepositoryPackCollection.pack_factory = NewPack
193
194
class GCRepositoryPackCollection(RepositoryPackCollection):
195
196
    pack_factory = GCPack
197
198
    def _make_index(self, name, suffix):
199
        """Overridden to use BTreeGraphIndex objects."""
200
        size_offset = self._suffix_offsets[suffix]
201
        index_name = name + suffix
202
        index_size = self._names[name][size_offset]
203
        return BTreeGraphIndex(
204
            self._index_transport, index_name, index_size)
205
206
    def _start_write_group(self):
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
207
        # Overridden to add 'self.pack_factory()'
0.17.9 by Robert Collins
Initial stab at repository format support.
208
        # Do not permit preparation for writing if we're not in a 'write lock'.
209
        if not self.repo.is_write_locked():
210
            raise errors.NotWriteLocked(self)
0.17.22 by Robert Collins
really get gc working with 1.10
211
        self._new_pack = self.pack_factory(self, upload_suffix='.pack',
0.17.9 by Robert Collins
Initial stab at repository format support.
212
            file_mode=self.repo.bzrdir._get_file_mode())
213
        # allow writing: queue writes to a new index
214
        self.revision_index.add_writable_index(self._new_pack.revision_index,
215
            self._new_pack)
216
        self.inventory_index.add_writable_index(self._new_pack.inventory_index,
217
            self._new_pack)
218
        self.text_index.add_writable_index(self._new_pack.text_index,
219
            self._new_pack)
220
        self.signature_index.add_writable_index(self._new_pack.signature_index,
221
            self._new_pack)
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
222
        if chk_support and self.chk_index is not None:
223
            self.chk_index.add_writable_index(self._new_pack.chk_index,
224
                self._new_pack)
225
            self.repo.chk_bytes._index._add_callback = self.chk_index.add_callback
0.17.9 by Robert Collins
Initial stab at repository format support.
226
227
        self.repo.inventories._index._add_callback = self.inventory_index.add_callback
228
        self.repo.revisions._index._add_callback = self.revision_index.add_callback
229
        self.repo.signatures._index._add_callback = self.signature_index.add_callback
230
        self.repo.texts._index._add_callback = self.text_index.add_callback
231
232
233
234
class GCPackRepository(KnitPackRepository):
235
    """GC customisation of KnitPackRepository."""
236
237
    def __init__(self, _format, a_bzrdir, control_files, _commit_builder_class,
238
        _serializer):
239
        """Overridden to change pack collection class."""
240
        KnitPackRepository.__init__(self, _format, a_bzrdir, control_files,
241
            _commit_builder_class, _serializer)
242
        # and now replace everything it did :)
243
        index_transport = self._transport.clone('indices')
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
244
        if chk_support:
245
            self._pack_collection = GCRepositoryPackCollection(self,
246
                self._transport, index_transport,
247
                self._transport.clone('upload'),
248
                self._transport.clone('packs'),
249
                _format.index_builder_class,
250
                _format.index_class,
251
                use_chk_index=self._format.supports_chks,
252
                )
253
        else:
254
            self._pack_collection = GCRepositoryPackCollection(self,
255
                self._transport, index_transport,
256
                self._transport.clone('upload'),
257
                self._transport.clone('packs'),
258
                _format.index_builder_class,
259
                _format.index_class)
0.17.9 by Robert Collins
Initial stab at repository format support.
260
        self.inventories = GroupCompressVersionedFiles(
261
            _GCGraphIndex(self._pack_collection.inventory_index.combined_index,
262
                add_callback=self._pack_collection.inventory_index.add_callback,
263
                parents=True, is_locked=self.is_locked),
264
            access=self._pack_collection.inventory_index.data_access)
265
        self.revisions = GroupCompressVersionedFiles(
266
            _GCGraphIndex(self._pack_collection.revision_index.combined_index,
267
                add_callback=self._pack_collection.revision_index.add_callback,
268
                parents=True, is_locked=self.is_locked),
269
            access=self._pack_collection.revision_index.data_access,
270
            delta=False)
271
        self.signatures = GroupCompressVersionedFiles(
272
            _GCGraphIndex(self._pack_collection.signature_index.combined_index,
273
                add_callback=self._pack_collection.signature_index.add_callback,
274
                parents=False, is_locked=self.is_locked),
275
            access=self._pack_collection.signature_index.data_access,
276
            delta=False)
277
        self.texts = GroupCompressVersionedFiles(
278
            _GCGraphIndex(self._pack_collection.text_index.combined_index,
279
                add_callback=self._pack_collection.text_index.add_callback,
280
                parents=True, is_locked=self.is_locked),
281
            access=self._pack_collection.text_index.data_access)
0.17.26 by Robert Collins
Working better --gc-plain-chk.
282
        if chk_support and _format.supports_chks:
283
            # No graph, no compression:- references from chks are between
284
            # different objects not temporal versions of the same; and without
285
            # some sort of temporal structure knit compression will just fail.
286
            self.chk_bytes = GroupCompressVersionedFiles(
287
                _GCGraphIndex(self._pack_collection.chk_index.combined_index,
288
                    add_callback=self._pack_collection.chk_index.add_callback,
289
                    parents=False, is_locked=self.is_locked),
290
                access=self._pack_collection.chk_index.data_access)
291
        else:
292
            self.chk_bytes = None
0.17.9 by Robert Collins
Initial stab at repository format support.
293
        # True when the repository object is 'write locked' (as opposed to the
294
        # physical lock only taken out around changes to the pack-names list.) 
295
        # Another way to represent this would be a decorator around the control
296
        # files object that presents logical locks as physical ones - if this
297
        # gets ugly consider that alternative design. RBC 20071011
298
        self._write_lock_count = 0
299
        self._transaction = None
300
        # for tests
301
        self._reconcile_does_inventory_gc = True
302
        self._reconcile_fixes_text_parents = True
303
        self._reconcile_backsup_inventory = False
304
305
0.17.26 by Robert Collins
Working better --gc-plain-chk.
306
if chk_support:
307
    class GCCHKPackRepository(CHKInventoryRepository):
308
        """GC customisation of CHKInventoryRepository."""
309
310
        def __init__(self, _format, a_bzrdir, control_files, _commit_builder_class,
311
            _serializer):
312
            """Overridden to change pack collection class."""
313
            KnitPackRepository.__init__(self, _format, a_bzrdir, control_files,
314
                _commit_builder_class, _serializer)
315
            # and now replace everything it did :)
316
            index_transport = self._transport.clone('indices')
0.20.4 by John Arbash Meinel
Simplify the internals. We've already checked 'chk_support' so we don't need to check again.
317
            self._pack_collection = GCRepositoryPackCollection(self,
318
                self._transport, index_transport,
319
                self._transport.clone('upload'),
320
                self._transport.clone('packs'),
321
                _format.index_builder_class,
322
                _format.index_class,
323
                use_chk_index=self._format.supports_chks,
324
                )
0.17.26 by Robert Collins
Working better --gc-plain-chk.
325
            self.inventories = GroupCompressVersionedFiles(
326
                _GCGraphIndex(self._pack_collection.inventory_index.combined_index,
327
                    add_callback=self._pack_collection.inventory_index.add_callback,
328
                    parents=True, is_locked=self.is_locked),
329
                access=self._pack_collection.inventory_index.data_access)
330
            self.revisions = GroupCompressVersionedFiles(
331
                _GCGraphIndex(self._pack_collection.revision_index.combined_index,
332
                    add_callback=self._pack_collection.revision_index.add_callback,
333
                    parents=True, is_locked=self.is_locked),
334
                access=self._pack_collection.revision_index.data_access,
335
                delta=False)
336
            self.signatures = GroupCompressVersionedFiles(
337
                _GCGraphIndex(self._pack_collection.signature_index.combined_index,
338
                    add_callback=self._pack_collection.signature_index.add_callback,
339
                    parents=False, is_locked=self.is_locked),
340
                access=self._pack_collection.signature_index.data_access,
341
                delta=False)
342
            self.texts = GroupCompressVersionedFiles(
343
                _GCGraphIndex(self._pack_collection.text_index.combined_index,
344
                    add_callback=self._pack_collection.text_index.add_callback,
345
                    parents=True, is_locked=self.is_locked),
346
                access=self._pack_collection.text_index.data_access)
0.20.4 by John Arbash Meinel
Simplify the internals. We've already checked 'chk_support' so we don't need to check again.
347
            assert _format.supports_chks
348
            # No parents, individual CHK pages don't have specific ancestry
349
            self.chk_bytes = GroupCompressVersionedFiles(
350
                _GCGraphIndex(self._pack_collection.chk_index.combined_index,
351
                    add_callback=self._pack_collection.chk_index.add_callback,
352
                    parents=False, is_locked=self.is_locked),
353
                access=self._pack_collection.chk_index.data_access)
0.17.26 by Robert Collins
Working better --gc-plain-chk.
354
            # True when the repository object is 'write locked' (as opposed to the
0.20.4 by John Arbash Meinel
Simplify the internals. We've already checked 'chk_support' so we don't need to check again.
355
            # physical lock only taken out around changes to the pack-names list.)
0.17.26 by Robert Collins
Working better --gc-plain-chk.
356
            # Another way to represent this would be a decorator around the control
357
            # files object that presents logical locks as physical ones - if this
358
            # gets ugly consider that alternative design. RBC 20071011
359
            self._write_lock_count = 0
360
            self._transaction = None
361
            # for tests
362
            self._reconcile_does_inventory_gc = True
363
            self._reconcile_fixes_text_parents = True
364
            self._reconcile_backsup_inventory = False
365
366
0.17.21 by Robert Collins
Update groupcompress to bzrlib 1.10.
367
class RepositoryFormatPackGCPlain(RepositoryFormatPackDevelopment2):
0.17.9 by Robert Collins
Initial stab at repository format support.
368
    """A B+Tree index using pack repository."""
369
370
    repository_class = GCPackRepository
371
372
    def get_format_string(self):
373
        """See RepositoryFormat.get_format_string()."""
374
        return ("Bazaar development format - btree+gc "
375
            "(needs bzr.dev from 1.6)\n")
376
377
    def get_format_description(self):
378
        """See RepositoryFormat.get_format_description()."""
379
        return ("Development repository format - btree+groupcompress "
380
            ", interoperates with pack-0.92\n")
381
382
383
class RepositoryFormatPackGCRichRoot(RepositoryFormatKnitPack4):
384
    """A B+Tree index using pack repository."""
385
386
    repository_class = GCPackRepository
387
388
    def get_format_string(self):
389
        """See RepositoryFormat.get_format_string()."""
390
        return ("Bazaar development format - btree+gc-rich-root "
391
            "(needs bzr.dev from 1.6)\n")
392
393
    def get_format_description(self):
394
        """See RepositoryFormat.get_format_description()."""
395
        return ("Development repository format - btree+groupcompress "
396
            ", interoperates with rich-root-pack\n")
397
398
0.17.21 by Robert Collins
Update groupcompress to bzrlib 1.10.
399
class RepositoryFormatPackGCSubtrees(RepositoryFormatPackDevelopment2Subtree):
0.17.9 by Robert Collins
Initial stab at repository format support.
400
    """A B+Tree index using pack repository."""
401
402
    repository_class = GCPackRepository
403
404
    def get_format_string(self):
405
        """See RepositoryFormat.get_format_string()."""
406
        return ("Bazaar development format - btree+gc-subtrees "
407
            "(needs bzr.dev from 1.6)\n")
408
409
    def get_format_description(self):
410
        """See RepositoryFormat.get_format_description()."""
411
        return ("Development repository format - btree+groupcompress "
412
            ", interoperates with pack-0.92-subtrees\n")
413
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
414
if chk_support:
0.21.1 by John Arbash Meinel
Start basing the groupcompress chk formats on the dev5 formats.
415
    class RepositoryFormatPackGCPlainCHK(RepositoryFormatPackDevelopment5):
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
416
        """A CHK+group compress pack repository."""
417
0.17.26 by Robert Collins
Working better --gc-plain-chk.
418
        repository_class = GCCHKPackRepository
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
419
420
        def get_format_string(self):
421
            """See RepositoryFormat.get_format_string()."""
0.21.1 by John Arbash Meinel
Start basing the groupcompress chk formats on the dev5 formats.
422
            return ('Bazaar development format - chk+gc'
423
                    ' (needs bzr.dev from 1.13)\n')
424
425
        def get_format_description(self):
426
            """See RepositoryFormat.get_format_description()."""
427
            return ("Development repository format - chk+groupcompress")
428
0.21.2 by John Arbash Meinel
Bring in the trunk simplifications.
429
0.21.1 by John Arbash Meinel
Start basing the groupcompress chk formats on the dev5 formats.
430
    class RepositoryFormatPackGCPlainCHK16(RepositoryFormatPackDevelopment5Hash16):
431
        """A hashed CHK+group compress pack repository."""
432
433
        repository_class = GCCHKPackRepository
434
435
        def get_format_string(self):
436
            """See RepositoryFormat.get_format_string()."""
437
            return ('Bazaar development format - hash16chk+gc'
438
                    ' (needs bzr.dev from 1.13)\n')
439
440
        def get_format_description(self):
441
            """See RepositoryFormat.get_format_description()."""
442
            return ("Development repository format - hash16chk+groupcompress")
0.17.25 by Robert Collins
Preliminary --gc-plain-chk support.
443
444
0.21.3 by John Arbash Meinel
Start putting together a GroupCompress format that is built on dev5
445
    class RepositoryFormatPackGCPlainCHK255(RepositoryFormatPackDevelopment5Hash255):
446
        """A hashed CHK+group compress pack repository."""
447
448
        repository_class = GCCHKPackRepository
449
450
        def get_format_string(self):
451
            """See RepositoryFormat.get_format_string()."""
452
            return ('Bazaar development format - hash255chk+gc'
453
                    ' (needs bzr.dev from 1.13)\n')
454
455
        def get_format_description(self):
456
            """See RepositoryFormat.get_format_description()."""
457
            return ("Development repository format - hash255chk+groupcompress")
458
459
0.17.9 by Robert Collins
Initial stab at repository format support.
460
def pack_incompatible(source, target, orig_method=InterPackRepo.is_compatible):
0.17.26 by Robert Collins
Working better --gc-plain-chk.
461
    """Be incompatible with the regular fetch code."""
0.17.9 by Robert Collins
Initial stab at repository format support.
462
    formats = (RepositoryFormatPackGCPlain, RepositoryFormatPackGCRichRoot,
463
        RepositoryFormatPackGCSubtrees)
0.17.26 by Robert Collins
Working better --gc-plain-chk.
464
    if chk_support:
0.21.1 by John Arbash Meinel
Start basing the groupcompress chk formats on the dev5 formats.
465
        formats = formats + (RepositoryFormatPackGCPlainCHK,
0.21.3 by John Arbash Meinel
Start putting together a GroupCompress format that is built on dev5
466
                             RepositoryFormatPackGCPlainCHK16,
467
                             RepositoryFormatPackGCPlainCHK255)
0.17.10 by Robert Collins
Correct optimiser disabling.
468
    if isinstance(source._format, formats) or isinstance(target._format, formats):
0.17.9 by Robert Collins
Initial stab at repository format support.
469
        return False
470
    else:
471
        return orig_method(source, target)
472
473
474
InterPackRepo.is_compatible = staticmethod(pack_incompatible)