~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/weaverepo.py

  • Committer: Martin Pool
  • Date: 2009-08-14 11:11:29 UTC
  • mto: (4599.4.26 bug-398668)
  • mto: This revision was merged to the branch mainline in revision 4622.
  • Revision ID: mbp@sourcefrog.net-20090814111129-ozigh3o0jjfojiix
Remove redundant overrides of check_conversion_target

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
28
28
lazy_import(globals(), """
29
29
from bzrlib import (
30
30
    xml5,
31
 
    graph as _mod_graph,
32
31
    )
33
32
""")
34
33
from bzrlib import (
39
38
    lockdir,
40
39
    osutils,
41
40
    revision as _mod_revision,
42
 
    trace,
43
41
    urlutils,
44
42
    versionedfile,
45
43
    weave,
54
52
    RepositoryFormat,
55
53
    )
56
54
from bzrlib.store.text import TextStore
 
55
from bzrlib.trace import mutter
57
56
from bzrlib.tuned_gzip import GzipFile, bytes_to_gzip
58
57
from bzrlib.versionedfile import (
59
58
    AbsentContentFactory,
106
105
    def _all_possible_ids(self):
107
106
        """Return all the possible revisions that we could find."""
108
107
        if 'evil' in debug.debug_flags:
109
 
            trace.mutter_callsite(
110
 
                3, "_all_possible_ids scales with size of history.")
 
108
            mutter_callsite(3, "_all_possible_ids scales with size of history.")
111
109
        return [key[-1] for key in self.inventories.keys()]
112
110
 
113
111
    @needs_read_lock
177
175
        :param new_value: True to restore the default, False to disable making
178
176
                          working trees.
179
177
        """
180
 
        raise errors.RepositoryUpgradeRequired(self.user_url)
 
178
        raise errors.RepositoryUpgradeRequired(self.bzrdir.root_transport.base)
181
179
 
182
180
    def make_working_trees(self):
183
181
        """Returns the policy for making working trees on new branches."""
200
198
    def _all_possible_ids(self):
201
199
        """Return all the possible revisions that we could find."""
202
200
        if 'evil' in debug.debug_flags:
203
 
            trace.mutter_callsite(
204
 
                3, "_all_possible_ids scales with size of history.")
 
201
            mutter_callsite(3, "_all_possible_ids scales with size of history.")
205
202
        return [key[-1] for key in self.inventories.keys()]
206
203
 
207
204
    @needs_read_lock
288
285
        weavefile.write_weave_v5(weave.Weave(), sio)
289
286
        empty_weave = sio.getvalue()
290
287
 
291
 
        trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
 
288
        mutter('creating repository in %s.', a_bzrdir.transport.base)
292
289
 
293
290
        # FIXME: RBC 20060125 don't peek under the covers
294
291
        # NB: no need to escape relative paths that are url safe.
304
301
                mode=a_bzrdir._get_file_mode())
305
302
        finally:
306
303
            control_files.unlock()
307
 
        repository = self.open(a_bzrdir, _found=True)
308
 
        self._run_post_repo_init_hooks(repository, a_bzrdir, shared)
309
 
        return repository
 
304
        return self.open(a_bzrdir, _found=True)
310
305
 
311
306
    def open(self, a_bzrdir, _found=False):
312
307
        """See RepositoryFormat.open()."""
528
523
        weavefile.write_weave_v5(weave.Weave(), sio)
529
524
        empty_weave = sio.getvalue()
530
525
 
531
 
        trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
 
526
        mutter('creating repository in %s.', a_bzrdir.transport.base)
532
527
        dirs = ['revision-store', 'weaves']
533
528
        files = [('inventory.weave', StringIO(empty_weave)),
534
529
                 ]
668
663
            result[key] = parents
669
664
        return result
670
665
 
671
 
    def get_known_graph_ancestry(self, keys):
672
 
        """Get a KnownGraph instance with the ancestry of keys."""
673
 
        keys = self.keys()
674
 
        parent_map = self.get_parent_map(keys)
675
 
        kg = _mod_graph.KnownGraph(parent_map)
676
 
        return kg
677
 
 
678
666
    def get_record_stream(self, keys, sort_order, include_delta_closure):
679
667
        for key in keys:
680
668
            text, parents = self._load_text_parents(key)
692
680
            path, ext = os.path.splitext(relpath)
693
681
            if ext == '.gz':
694
682
                relpath = path
695
 
            if not relpath.endswith('.sig'):
 
683
            if '.sig' not in relpath:
696
684
                relpaths.add(relpath)
697
685
        paths = list(relpaths)
698
686
        return set([self._mapper.unmap(path) for path in paths])