~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-03-22 09:57:11 UTC
  • mfrom: (5724.1.4 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20110322095711-9bggm9tnxnw9frow
(jameinel) Fix tar exporters to always write to binary streams. (John A
 Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    versionedfile,
47
47
    )
48
48
from bzrlib.bundle import serializer
 
49
from bzrlib.recordcounter import RecordCounter
49
50
from bzrlib.revisiontree import RevisionTree
50
51
from bzrlib.store.versioned import VersionedFileStore
51
52
from bzrlib.testament import Testament
65
66
    ROOT_ID,
66
67
    entry_factory,
67
68
    )
68
 
from bzrlib.recordcounter import RecordCounter
69
69
from bzrlib.lock import _RelockDebugMixin, LogicalLockResult
70
70
from bzrlib.trace import (
71
71
    log_exception_quietly, note, mutter, mutter_callsite, warning)
94
94
    record_root_entry = True
95
95
    # the default CommitBuilder does not manage trees whose root is versioned.
96
96
    _versioned_root = False
 
97
    # this commit builder supports the record_entry_contents interface
 
98
    supports_record_entry_contents = True
97
99
 
98
100
    def __init__(self, repository, parents, config, timestamp=None,
99
101
                 timezone=None, committer=None, revprops=None,
3218
3220
        return self.get_format_string()
3219
3221
 
3220
3222
 
3221
 
# Pre-0.8 formats that don't have a disk format string (because they are
3222
 
# versioned by the matching control directory). We use the control directories
3223
 
# disk format string as a key for the network_name because they meet the
3224
 
# constraints (simple string, unique, immutable).
3225
 
network_format_registry.register_lazy(
3226
 
    "Bazaar-NG branch, format 5\n",
3227
 
    'bzrlib.repofmt.weaverepo',
3228
 
    'RepositoryFormat5',
3229
 
)
3230
 
network_format_registry.register_lazy(
3231
 
    "Bazaar-NG branch, format 6\n",
3232
 
    'bzrlib.repofmt.weaverepo',
3233
 
    'RepositoryFormat6',
3234
 
)
3235
 
 
3236
 
format_registry.register_extra_lazy(
3237
 
    'bzrlib.repofmt.weaverepo',
3238
 
    'RepositoryFormat4')
3239
 
format_registry.register_extra_lazy(
3240
 
    'bzrlib.repofmt.weaverepo',
3241
 
    'RepositoryFormat5')
3242
 
format_registry.register_extra_lazy(
3243
 
    'bzrlib.repofmt.weaverepo',
3244
 
    'RepositoryFormat6')
3245
 
 
3246
3223
# formats which have no format string are not discoverable or independently
3247
3224
# creatable on disk, so are not registered in format_registry.  They're
3248
 
# all in bzrlib.repofmt.weaverepo now.  When an instance of one of these is
 
3225
# all in bzrlib.repofmt.knitreponow.  When an instance of one of these is
3249
3226
# needed, it's constructed directly by the BzrDir.  Non-native formats where
3250
3227
# the repository is not separately opened are similar.
3251
3228
 
3252
3229
format_registry.register_lazy(
3253
 
    'Bazaar-NG Repository format 7',
3254
 
    'bzrlib.repofmt.weaverepo',
3255
 
    'RepositoryFormat7'
3256
 
    )
3257
 
 
3258
 
format_registry.register_lazy(
3259
3230
    'Bazaar-NG Knit Repository Format 1',
3260
3231
    'bzrlib.repofmt.knitrepo',
3261
3232
    'RepositoryFormatKnit1',
4024
3995
        return wrong_parents, unused_keys
4025
3996
 
4026
3997
 
4027
 
def _old_get_graph(repository, revision_id):
4028
 
    """DO NOT USE. That is all. I'm serious."""
4029
 
    graph = repository.get_graph()
4030
 
    revision_graph = dict(((key, value) for key, value in
4031
 
        graph.iter_ancestry([revision_id]) if value is not None))
4032
 
    return _strip_NULL_ghosts(revision_graph)
4033
 
 
4034
 
 
4035
3998
def _strip_NULL_ghosts(revision_graph):
4036
3999
    """Also don't use this. more compatibility code for unmigrated clients."""
4037
4000
    # Filter ghosts, and null:
4551
4514
    except StopIteration:
4552
4515
        # No more history
4553
4516
        return
4554
 
 
4555
 
 
4556