/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: 2009-08-17 22:08:21 UTC
  • mto: This revision was merged to the branch mainline in revision 4629.
  • Revision ID: john@arbash-meinel.com-20090817220821-wzul2cdupe88xi7t
a few more implementations of the interface.

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
39
39
    lockdir,
40
40
    osutils,
41
41
    revision as _mod_revision,
42
 
    trace,
43
42
    urlutils,
44
43
    versionedfile,
45
44
    weave,
54
53
    RepositoryFormat,
55
54
    )
56
55
from bzrlib.store.text import TextStore
 
56
from bzrlib.trace import mutter
57
57
from bzrlib.tuned_gzip import GzipFile, bytes_to_gzip
58
58
from bzrlib.versionedfile import (
59
59
    AbsentContentFactory,
106
106
    def _all_possible_ids(self):
107
107
        """Return all the possible revisions that we could find."""
108
108
        if 'evil' in debug.debug_flags:
109
 
            trace.mutter_callsite(
110
 
                3, "_all_possible_ids scales with size of history.")
 
109
            mutter_callsite(3, "_all_possible_ids scales with size of history.")
111
110
        return [key[-1] for key in self.inventories.keys()]
112
111
 
113
112
    @needs_read_lock
177
176
        :param new_value: True to restore the default, False to disable making
178
177
                          working trees.
179
178
        """
180
 
        raise errors.RepositoryUpgradeRequired(self.user_url)
 
179
        raise errors.RepositoryUpgradeRequired(self.bzrdir.root_transport.base)
181
180
 
182
181
    def make_working_trees(self):
183
182
        """Returns the policy for making working trees on new branches."""
200
199
    def _all_possible_ids(self):
201
200
        """Return all the possible revisions that we could find."""
202
201
        if 'evil' in debug.debug_flags:
203
 
            trace.mutter_callsite(
204
 
                3, "_all_possible_ids scales with size of history.")
 
202
            mutter_callsite(3, "_all_possible_ids scales with size of history.")
205
203
        return [key[-1] for key in self.inventories.keys()]
206
204
 
207
205
    @needs_read_lock
288
286
        weavefile.write_weave_v5(weave.Weave(), sio)
289
287
        empty_weave = sio.getvalue()
290
288
 
291
 
        trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
 
289
        mutter('creating repository in %s.', a_bzrdir.transport.base)
292
290
 
293
291
        # FIXME: RBC 20060125 don't peek under the covers
294
292
        # NB: no need to escape relative paths that are url safe.
304
302
                mode=a_bzrdir._get_file_mode())
305
303
        finally:
306
304
            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
 
305
        return self.open(a_bzrdir, _found=True)
310
306
 
311
307
    def open(self, a_bzrdir, _found=False):
312
308
        """See RepositoryFormat.open()."""
324
320
        result.chk_bytes = None
325
321
        return result
326
322
 
 
323
    def check_conversion_target(self, target_format):
 
324
        pass
 
325
 
327
326
 
328
327
class RepositoryFormat4(PreSplitOutRepositoryFormat):
329
328
    """Bzr repository format 4.
496
495
        """See RepositoryFormat.get_format_description()."""
497
496
        return "Weave repository format 7"
498
497
 
 
498
    def check_conversion_target(self, target_format):
 
499
        pass
 
500
 
499
501
    def _get_inventories(self, repo_transport, repo, name='inventory'):
500
502
        mapper = versionedfile.ConstantMapper(name)
501
503
        return versionedfile.ThunkedVersionedFiles(repo_transport,
528
530
        weavefile.write_weave_v5(weave.Weave(), sio)
529
531
        empty_weave = sio.getvalue()
530
532
 
531
 
        trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
 
533
        mutter('creating repository in %s.', a_bzrdir.transport.base)
532
534
        dirs = ['revision-store', 'weaves']
533
535
        files = [('inventory.weave', StringIO(empty_weave)),
534
536
                 ]
692
694
            path, ext = os.path.splitext(relpath)
693
695
            if ext == '.gz':
694
696
                relpath = path
695
 
            if not relpath.endswith('.sig'):
 
697
            if '.sig' not in relpath:
696
698
                relpaths.add(relpath)
697
699
        paths = list(relpaths)
698
700
        return set([self._mapper.unmap(path) for path in paths])