/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/weaverepo.py

  • Committer: John Arbash Meinel
  • Date: 2008-05-21 15:42:47 UTC
  • mto: This revision was merged to the branch mainline in revision 3465.
  • Revision ID: john@arbash-meinel.com-20080521154247-sqpkv9um9grku9e1
Add tests for Branch.missing_revisions and deprecate it.

The api uses a 'stop_revision' but it is supposed to be a revno, not a
revision_id. The code itself is very crufty and slow (and doesn't take
a read_lock). But rather than fix it, just nuke the function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
 
 
17
"""Deprecated weave-based repository formats.
 
18
 
 
19
Weave based formats scaled linearly with history size and could not represent
 
20
ghosts.
 
21
"""
 
22
 
 
23
from StringIO import StringIO
 
24
 
 
25
from bzrlib import (
 
26
    bzrdir,
 
27
    debug,
 
28
    errors,
 
29
    lockable_files,
 
30
    lockdir,
 
31
    osutils,
 
32
    revision as _mod_revision,
 
33
    weave,
 
34
    weavefile,
 
35
    xml5,
 
36
    )
 
37
from bzrlib.decorators import needs_read_lock, needs_write_lock
 
38
from bzrlib.repository import (
 
39
    CommitBuilder,
 
40
    MetaDirVersionedFileRepository,
 
41
    MetaDirRepositoryFormat,
 
42
    Repository,
 
43
    RepositoryFormat,
 
44
    )
 
45
from bzrlib.store.text import TextStore
 
46
from bzrlib.trace import mutter
 
47
 
 
48
 
 
49
class AllInOneRepository(Repository):
 
50
    """Legacy support - the repository behaviour for all-in-one branches."""
 
51
 
 
52
    _serializer = xml5.serializer_v5
 
53
 
 
54
    def __init__(self, _format, a_bzrdir, _revision_store, control_store, text_store):
 
55
        dir_mode = a_bzrdir._get_dir_mode()
 
56
        file_mode = a_bzrdir._get_file_mode()
 
57
 
 
58
        def get_store(name, compressed=True, prefixed=False):
 
59
            # FIXME: This approach of assuming stores are all entirely compressed
 
60
            # or entirely uncompressed is tidy, but breaks upgrade from 
 
61
            # some existing branches where there's a mixture; we probably 
 
62
            # still want the option to look for both.
 
63
            relpath = a_bzrdir._control_files._escape(name)
 
64
            store = TextStore(a_bzrdir._control_files._transport.clone(relpath),
 
65
                              prefixed=prefixed, compressed=compressed,
 
66
                              dir_mode=dir_mode,
 
67
                              file_mode=file_mode)
 
68
            return store
 
69
 
 
70
        # not broken out yet because the controlweaves|inventory_store
 
71
        # and text_store | weave_store bits are still different.
 
72
        if isinstance(_format, RepositoryFormat4):
 
73
            # cannot remove these - there is still no consistent api 
 
74
            # which allows access to this old info.
 
75
            self.inventory_store = get_store('inventory-store')
 
76
            text_store = get_store('text-store')
 
77
        super(AllInOneRepository, self).__init__(_format, a_bzrdir, a_bzrdir._control_files, _revision_store, control_store, text_store)
 
78
        if control_store is not None:
 
79
            control_store.get_scope = self.get_transaction
 
80
        text_store.get_scope = self.get_transaction
 
81
 
 
82
    @needs_read_lock
 
83
    def _all_possible_ids(self):
 
84
        """Return all the possible revisions that we could find."""
 
85
        if 'evil' in debug.debug_flags:
 
86
            mutter_callsite(3, "_all_possible_ids scales with size of history.")
 
87
        return self.get_inventory_weave().versions()
 
88
 
 
89
    @needs_read_lock
 
90
    def _all_revision_ids(self):
 
91
        """Returns a list of all the revision ids in the repository. 
 
92
 
 
93
        These are in as much topological order as the underlying store can 
 
94
        present: for weaves ghosts may lead to a lack of correctness until
 
95
        the reweave updates the parents list.
 
96
        """
 
97
        if self._revision_store.text_store.listable():
 
98
            return self._revision_store.all_revision_ids(self.get_transaction())
 
99
        result = self._all_possible_ids()
 
100
        # TODO: jam 20070210 Ensure that _all_possible_ids returns non-unicode
 
101
        #       ids. (It should, since _revision_store's API should change to
 
102
        #       return utf8 revision_ids)
 
103
        return self._eliminate_revisions_not_present(result)
 
104
 
 
105
    def _check_revision_parents(self, revision, inventory):
 
106
        """Private to Repository and Fetch.
 
107
        
 
108
        This checks the parentage of revision in an inventory weave for 
 
109
        consistency and is only applicable to inventory-weave-for-ancestry
 
110
        using repository formats & fetchers.
 
111
        """
 
112
        weave_parents = inventory.get_parent_map(
 
113
            [revision.revision_id])[revision.revision_id]
 
114
        parent_map = inventory.get_parent_map(revision.parent_ids)
 
115
        for parent_id in revision.parent_ids:
 
116
            if parent_id in parent_map:
 
117
                # this parent must not be a ghost.
 
118
                if not parent_id in weave_parents:
 
119
                    # but it is a ghost
 
120
                    raise errors.CorruptRepository(self)
 
121
 
 
122
    def get_commit_builder(self, branch, parents, config, timestamp=None,
 
123
                           timezone=None, committer=None, revprops=None,
 
124
                           revision_id=None):
 
125
        self._check_ascii_revisionid(revision_id, self.get_commit_builder)
 
126
        result = WeaveCommitBuilder(self, parents, config, timestamp, timezone,
 
127
                              committer, revprops, revision_id)
 
128
        self.start_write_group()
 
129
        return result
 
130
 
 
131
    @needs_read_lock
 
132
    def get_revisions(self, revision_ids):
 
133
        revs = self._get_revisions(revision_ids)
 
134
        # weave corruption can lead to absent revision markers that should be
 
135
        # present.
 
136
        # the following test is reasonably cheap (it needs a single weave read)
 
137
        # and the weave is cached in read transactions. In write transactions
 
138
        # it is not cached but typically we only read a small number of
 
139
        # revisions. For knits when they are introduced we will probably want
 
140
        # to ensure that caching write transactions are in use.
 
141
        inv = self.get_inventory_weave()
 
142
        for rev in revs:
 
143
            self._check_revision_parents(rev, inv)
 
144
        return revs
 
145
 
 
146
    def has_revisions(self, revision_ids):
 
147
        """See Repository.has_revisions()."""
 
148
        result = set()
 
149
        transaction = self.get_transaction()
 
150
        for revision_id in revision_ids:
 
151
            if self._revision_store.has_revision_id(revision_id, transaction):
 
152
                result.add(revision_id)
 
153
        return result
 
154
 
 
155
    @needs_read_lock
 
156
    def is_shared(self):
 
157
        """AllInOne repositories cannot be shared."""
 
158
        return False
 
159
 
 
160
    @needs_write_lock
 
161
    def set_make_working_trees(self, new_value):
 
162
        """Set the policy flag for making working trees when creating branches.
 
163
 
 
164
        This only applies to branches that use this repository.
 
165
 
 
166
        The default is 'True'.
 
167
        :param new_value: True to restore the default, False to disable making
 
168
                          working trees.
 
169
        """
 
170
        raise errors.RepositoryUpgradeRequired(self.bzrdir.root_transport.base)
 
171
 
 
172
    def make_working_trees(self):
 
173
        """Returns the policy for making working trees on new branches."""
 
174
        return True
 
175
 
 
176
    def revision_graph_can_have_wrong_parents(self):
 
177
        # XXX: This is an old format that we don't support full checking on, so
 
178
        # just claim that checking for this inconsistency is not required.
 
179
        return False
 
180
 
 
181
 
 
182
class WeaveMetaDirRepository(MetaDirVersionedFileRepository):
 
183
    """A subclass of MetaDirRepository to set weave specific policy."""
 
184
 
 
185
    _serializer = xml5.serializer_v5
 
186
 
 
187
    @needs_read_lock
 
188
    def _all_possible_ids(self):
 
189
        """Return all the possible revisions that we could find."""
 
190
        if 'evil' in debug.debug_flags:
 
191
            mutter_callsite(3, "_all_possible_ids scales with size of history.")
 
192
        return self.get_inventory_weave().versions()
 
193
 
 
194
    @needs_read_lock
 
195
    def _all_revision_ids(self):
 
196
        """Returns a list of all the revision ids in the repository. 
 
197
 
 
198
        These are in as much topological order as the underlying store can 
 
199
        present: for weaves ghosts may lead to a lack of correctness until
 
200
        the reweave updates the parents list.
 
201
        """
 
202
        if self._revision_store.text_store.listable():
 
203
            return self._revision_store.all_revision_ids(self.get_transaction())
 
204
        result = self._all_possible_ids()
 
205
        # TODO: jam 20070210 Ensure that _all_possible_ids returns non-unicode
 
206
        #       ids. (It should, since _revision_store's API should change to
 
207
        #       return utf8 revision_ids)
 
208
        return self._eliminate_revisions_not_present(result)
 
209
 
 
210
    def _check_revision_parents(self, revision, inventory):
 
211
        """Private to Repository and Fetch.
 
212
        
 
213
        This checks the parentage of revision in an inventory weave for 
 
214
        consistency and is only applicable to inventory-weave-for-ancestry
 
215
        using repository formats & fetchers.
 
216
        """
 
217
        weave_parents = inventory.get_parent_map(
 
218
            [revision.revision_id])[revision.revision_id]
 
219
        parent_map = inventory.get_parent_map(revision.parent_ids)
 
220
        for parent_id in revision.parent_ids:
 
221
            if parent_id in parent_map:
 
222
                # this parent must not be a ghost.
 
223
                if not parent_id in weave_parents:
 
224
                    # but it is a ghost
 
225
                    raise errors.CorruptRepository(self)
 
226
 
 
227
    def get_commit_builder(self, branch, parents, config, timestamp=None,
 
228
                           timezone=None, committer=None, revprops=None,
 
229
                           revision_id=None):
 
230
        self._check_ascii_revisionid(revision_id, self.get_commit_builder)
 
231
        result = WeaveCommitBuilder(self, parents, config, timestamp, timezone,
 
232
                              committer, revprops, revision_id)
 
233
        self.start_write_group()
 
234
        return result
 
235
 
 
236
    @needs_read_lock
 
237
    def get_revision(self, revision_id):
 
238
        """Return the Revision object for a named revision"""
 
239
        # TODO: jam 20070210 get_revision_reconcile should do this for us
 
240
        r = self.get_revision_reconcile(revision_id)
 
241
        # weave corruption can lead to absent revision markers that should be
 
242
        # present.
 
243
        # the following test is reasonably cheap (it needs a single weave read)
 
244
        # and the weave is cached in read transactions. In write transactions
 
245
        # it is not cached but typically we only read a small number of
 
246
        # revisions. For knits when they are introduced we will probably want
 
247
        # to ensure that caching write transactions are in use.
 
248
        inv = self.get_inventory_weave()
 
249
        self._check_revision_parents(r, inv)
 
250
        return r
 
251
 
 
252
    def has_revisions(self, revision_ids):
 
253
        """See Repository.has_revisions()."""
 
254
        result = set()
 
255
        transaction = self.get_transaction()
 
256
        for revision_id in revision_ids:
 
257
            if self._revision_store.has_revision_id(revision_id, transaction):
 
258
                result.add(revision_id)
 
259
        return result
 
260
 
 
261
    def revision_graph_can_have_wrong_parents(self):
 
262
        # XXX: This is an old format that we don't support full checking on, so
 
263
        # just claim that checking for this inconsistency is not required.
 
264
        return False
 
265
 
 
266
 
 
267
class PreSplitOutRepositoryFormat(RepositoryFormat):
 
268
    """Base class for the pre split out repository formats."""
 
269
 
 
270
    rich_root_data = False
 
271
    supports_tree_reference = False
 
272
    supports_ghosts = False
 
273
    supports_external_lookups = False
 
274
 
 
275
    def initialize(self, a_bzrdir, shared=False, _internal=False):
 
276
        """Create a weave repository."""
 
277
        if shared:
 
278
            raise errors.IncompatibleFormat(self, a_bzrdir._format)
 
279
 
 
280
        if not _internal:
 
281
            # always initialized when the bzrdir is.
 
282
            return self.open(a_bzrdir, _found=True)
 
283
        
 
284
        # Create an empty weave
 
285
        sio = StringIO()
 
286
        weavefile.write_weave_v5(weave.Weave(), sio)
 
287
        empty_weave = sio.getvalue()
 
288
 
 
289
        mutter('creating repository in %s.', a_bzrdir.transport.base)
 
290
        dirs = ['revision-store', 'weaves']
 
291
        files = [('inventory.weave', StringIO(empty_weave)),
 
292
                 ]
 
293
        
 
294
        # FIXME: RBC 20060125 don't peek under the covers
 
295
        # NB: no need to escape relative paths that are url safe.
 
296
        control_files = lockable_files.LockableFiles(a_bzrdir.transport,
 
297
                                'branch-lock', lockable_files.TransportLock)
 
298
        control_files.create_lock()
 
299
        control_files.lock_write()
 
300
        a_bzrdir.transport.mkdir_multi(dirs,
 
301
            mode=a_bzrdir._get_dir_mode())
 
302
        try:
 
303
            for file, content in files:
 
304
                control_files.put(file, content)
 
305
        finally:
 
306
            control_files.unlock()
 
307
        return self.open(a_bzrdir, _found=True)
 
308
 
 
309
    def _get_control_store(self, repo_transport, control_files):
 
310
        """Return the control store for this repository."""
 
311
        return self._get_versioned_file_store('',
 
312
                                              repo_transport,
 
313
                                              control_files,
 
314
                                              prefixed=False)
 
315
 
 
316
    def _get_text_store(self, transport, control_files):
 
317
        """Get a store for file texts for this format."""
 
318
        raise NotImplementedError(self._get_text_store)
 
319
 
 
320
    def open(self, a_bzrdir, _found=False):
 
321
        """See RepositoryFormat.open()."""
 
322
        if not _found:
 
323
            # we are being called directly and must probe.
 
324
            raise NotImplementedError
 
325
 
 
326
        repo_transport = a_bzrdir.get_repository_transport(None)
 
327
        control_files = a_bzrdir._control_files
 
328
        text_store = self._get_text_store(repo_transport, control_files)
 
329
        control_store = self._get_control_store(repo_transport, control_files)
 
330
        _revision_store = self._get_revision_store(repo_transport, control_files)
 
331
        return AllInOneRepository(_format=self,
 
332
                                  a_bzrdir=a_bzrdir,
 
333
                                  _revision_store=_revision_store,
 
334
                                  control_store=control_store,
 
335
                                  text_store=text_store)
 
336
 
 
337
    def check_conversion_target(self, target_format):
 
338
        pass
 
339
 
 
340
 
 
341
class RepositoryFormat4(PreSplitOutRepositoryFormat):
 
342
    """Bzr repository format 4.
 
343
 
 
344
    This repository format has:
 
345
     - flat stores
 
346
     - TextStores for texts, inventories,revisions.
 
347
 
 
348
    This format is deprecated: it indexes texts using a text id which is
 
349
    removed in format 5; initialization and write support for this format
 
350
    has been removed.
 
351
    """
 
352
 
 
353
    _matchingbzrdir = bzrdir.BzrDirFormat4()
 
354
 
 
355
    def __init__(self):
 
356
        super(RepositoryFormat4, self).__init__()
 
357
 
 
358
    def get_format_description(self):
 
359
        """See RepositoryFormat.get_format_description()."""
 
360
        return "Repository format 4"
 
361
 
 
362
    def initialize(self, url, shared=False, _internal=False):
 
363
        """Format 4 branches cannot be created."""
 
364
        raise errors.UninitializableFormat(self)
 
365
 
 
366
    def is_supported(self):
 
367
        """Format 4 is not supported.
 
368
 
 
369
        It is not supported because the model changed from 4 to 5 and the
 
370
        conversion logic is expensive - so doing it on the fly was not 
 
371
        feasible.
 
372
        """
 
373
        return False
 
374
 
 
375
    def _get_control_store(self, repo_transport, control_files):
 
376
        """Format 4 repositories have no formal control store at this point.
 
377
        
 
378
        This will cause any control-file-needing apis to fail - this is desired.
 
379
        """
 
380
        return None
 
381
    
 
382
    def _get_revision_store(self, repo_transport, control_files):
 
383
        """See RepositoryFormat._get_revision_store()."""
 
384
        from bzrlib.xml4 import serializer_v4
 
385
        return self._get_text_rev_store(repo_transport,
 
386
                                        control_files,
 
387
                                        'revision-store',
 
388
                                        serializer=serializer_v4)
 
389
 
 
390
    def _get_text_store(self, transport, control_files):
 
391
        """See RepositoryFormat._get_text_store()."""
 
392
 
 
393
 
 
394
class RepositoryFormat5(PreSplitOutRepositoryFormat):
 
395
    """Bzr control format 5.
 
396
 
 
397
    This repository format has:
 
398
     - weaves for file texts and inventory
 
399
     - flat stores
 
400
     - TextStores for revisions and signatures.
 
401
    """
 
402
 
 
403
    _versionedfile_class = weave.WeaveFile
 
404
    _matchingbzrdir = bzrdir.BzrDirFormat5()
 
405
 
 
406
    def __init__(self):
 
407
        super(RepositoryFormat5, self).__init__()
 
408
 
 
409
    def get_format_description(self):
 
410
        """See RepositoryFormat.get_format_description()."""
 
411
        return "Weave repository format 5"
 
412
 
 
413
    def _get_revision_store(self, repo_transport, control_files):
 
414
        """See RepositoryFormat._get_revision_store()."""
 
415
        """Return the revision store object for this a_bzrdir."""
 
416
        return self._get_text_rev_store(repo_transport,
 
417
                                        control_files,
 
418
                                        'revision-store',
 
419
                                        compressed=False)
 
420
 
 
421
    def _get_text_store(self, transport, control_files):
 
422
        """See RepositoryFormat._get_text_store()."""
 
423
        return self._get_versioned_file_store('weaves', transport, control_files, prefixed=False)
 
424
 
 
425
 
 
426
class RepositoryFormat6(PreSplitOutRepositoryFormat):
 
427
    """Bzr control format 6.
 
428
 
 
429
    This repository format has:
 
430
     - weaves for file texts and inventory
 
431
     - hash subdirectory based stores.
 
432
     - TextStores for revisions and signatures.
 
433
    """
 
434
 
 
435
    _versionedfile_class = weave.WeaveFile
 
436
    _matchingbzrdir = bzrdir.BzrDirFormat6()
 
437
 
 
438
    def __init__(self):
 
439
        super(RepositoryFormat6, self).__init__()
 
440
 
 
441
    def get_format_description(self):
 
442
        """See RepositoryFormat.get_format_description()."""
 
443
        return "Weave repository format 6"
 
444
 
 
445
    def _get_revision_store(self, repo_transport, control_files):
 
446
        """See RepositoryFormat._get_revision_store()."""
 
447
        return self._get_text_rev_store(repo_transport,
 
448
                                        control_files,
 
449
                                        'revision-store',
 
450
                                        compressed=False,
 
451
                                        prefixed=True)
 
452
 
 
453
    def _get_text_store(self, transport, control_files):
 
454
        """See RepositoryFormat._get_text_store()."""
 
455
        return self._get_versioned_file_store('weaves', transport, control_files)
 
456
 
 
457
class RepositoryFormat7(MetaDirRepositoryFormat):
 
458
    """Bzr repository 7.
 
459
 
 
460
    This repository format has:
 
461
     - weaves for file texts and inventory
 
462
     - hash subdirectory based stores.
 
463
     - TextStores for revisions and signatures.
 
464
     - a format marker of its own
 
465
     - an optional 'shared-storage' flag
 
466
     - an optional 'no-working-trees' flag
 
467
    """
 
468
 
 
469
    _versionedfile_class = weave.WeaveFile
 
470
    supports_ghosts = False
 
471
 
 
472
    def _get_control_store(self, repo_transport, control_files):
 
473
        """Return the control store for this repository."""
 
474
        return self._get_versioned_file_store('',
 
475
                                              repo_transport,
 
476
                                              control_files,
 
477
                                              prefixed=False)
 
478
 
 
479
    def get_format_string(self):
 
480
        """See RepositoryFormat.get_format_string()."""
 
481
        return "Bazaar-NG Repository format 7"
 
482
 
 
483
    def get_format_description(self):
 
484
        """See RepositoryFormat.get_format_description()."""
 
485
        return "Weave repository format 7"
 
486
 
 
487
    def check_conversion_target(self, target_format):
 
488
        pass
 
489
 
 
490
    def _get_revision_store(self, repo_transport, control_files):
 
491
        """See RepositoryFormat._get_revision_store()."""
 
492
        return self._get_text_rev_store(repo_transport,
 
493
                                        control_files,
 
494
                                        'revision-store',
 
495
                                        compressed=False,
 
496
                                        prefixed=True,
 
497
                                        )
 
498
 
 
499
    def _get_text_store(self, transport, control_files):
 
500
        """See RepositoryFormat._get_text_store()."""
 
501
        return self._get_versioned_file_store('weaves',
 
502
                                              transport,
 
503
                                              control_files)
 
504
 
 
505
    def initialize(self, a_bzrdir, shared=False):
 
506
        """Create a weave repository.
 
507
 
 
508
        :param shared: If true the repository will be initialized as a shared
 
509
                       repository.
 
510
        """
 
511
        # Create an empty weave
 
512
        sio = StringIO()
 
513
        weavefile.write_weave_v5(weave.Weave(), sio)
 
514
        empty_weave = sio.getvalue()
 
515
 
 
516
        mutter('creating repository in %s.', a_bzrdir.transport.base)
 
517
        dirs = ['revision-store', 'weaves']
 
518
        files = [('inventory.weave', StringIO(empty_weave)), 
 
519
                 ]
 
520
        utf8_files = [('format', self.get_format_string())]
 
521
 
 
522
        self._upload_blank_content(a_bzrdir, dirs, files, utf8_files, shared)
 
523
        return self.open(a_bzrdir=a_bzrdir, _found=True)
 
524
 
 
525
    def open(self, a_bzrdir, _found=False, _override_transport=None):
 
526
        """See RepositoryFormat.open().
 
527
        
 
528
        :param _override_transport: INTERNAL USE ONLY. Allows opening the
 
529
                                    repository at a slightly different url
 
530
                                    than normal. I.e. during 'upgrade'.
 
531
        """
 
532
        if not _found:
 
533
            format = RepositoryFormat.find_format(a_bzrdir)
 
534
        if _override_transport is not None:
 
535
            repo_transport = _override_transport
 
536
        else:
 
537
            repo_transport = a_bzrdir.get_repository_transport(None)
 
538
        control_files = lockable_files.LockableFiles(repo_transport,
 
539
                                'lock', lockdir.LockDir)
 
540
        text_store = self._get_text_store(repo_transport, control_files)
 
541
        control_store = self._get_control_store(repo_transport, control_files)
 
542
        _revision_store = self._get_revision_store(repo_transport, control_files)
 
543
        return WeaveMetaDirRepository(_format=self,
 
544
            a_bzrdir=a_bzrdir,
 
545
            control_files=control_files,
 
546
            _revision_store=_revision_store,
 
547
            control_store=control_store,
 
548
            text_store=text_store)
 
549
 
 
550
 
 
551
class WeaveCommitBuilder(CommitBuilder):
 
552
    """A builder for weave based repos that don't support ghosts."""
 
553
 
 
554
    def _add_text_to_weave(self, file_id, new_lines, parents, nostore_sha):
 
555
        versionedfile = self.repository.weave_store.get_weave_or_empty(
 
556
            file_id, self.repository.get_transaction())
 
557
        result = versionedfile.add_lines(
 
558
            self._new_revision_id, parents, new_lines,
 
559
            nostore_sha=nostore_sha)[0:2]
 
560
        return result
 
561
 
 
562
 
 
563
_legacy_formats = [RepositoryFormat4(),
 
564
                   RepositoryFormat5(),
 
565
                   RepositoryFormat6()]