~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Aaron Bentley
  • Date: 2006-08-16 19:13:00 UTC
  • mfrom: (1934 +trunk)
  • mto: (1910.2.43 format-bumps)
  • mto: This revision was merged to the branch mainline in revision 1935.
  • Revision ID: abentley@panoramicfeedback.com-20060816191300-045772b26b975d1c
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        zero_nine, 
42
42
        )
43
43
from bzrlib.testament import Testament
44
 
from bzrlib.trace import mutter, note
 
44
from bzrlib.trace import mutter, note, warning
45
45
from bzrlib.tsort import topo_sort
46
46
from bzrlib.weave import WeaveFile
47
47
 
48
48
 
 
49
# Old formats display a warning, but only once
 
50
_deprecation_warning_done = False
 
51
 
 
52
 
49
53
class Repository(object):
50
54
    """Repository holding history for one or more branches.
51
55
 
190
194
        self.control_weaves = control_store
191
195
        # TODO: make sure to construct the right store classes, etc, depending
192
196
        # on whether escaping is required.
 
197
        self._warn_if_deprecated()
193
198
 
194
199
    def __repr__(self):
195
200
        return '%s(%r)' % (self.__class__.__name__, 
684
689
        result.check()
685
690
        return result
686
691
 
 
692
    def _warn_if_deprecated(self):
 
693
        global _deprecation_warning_done
 
694
        if _deprecation_warning_done:
 
695
            return
 
696
        _deprecation_warning_done = True
 
697
        warning("Format %s for %s is deprecated - please use 'bzr upgrade' to get better performance"
 
698
                % (self._format, self.bzrdir.transport.base))
 
699
 
687
700
 
688
701
class AllInOneRepository(Repository):
689
702
    """Legacy support - the repository behaviour for all-in-one branches."""
796
809
                                                _revision_store,
797
810
                                                control_store,
798
811
                                                text_store)
799
 
 
800
812
        dir_mode = self.control_files._dir_mode
801
813
        file_mode = self.control_files._file_mode
802
814
 
831
843
class KnitRepository(MetaDirRepository):
832
844
    """Knit format repository."""
833
845
 
 
846
    def _warn_if_deprecated(self):
 
847
        # This class isn't deprecated
 
848
        pass
 
849
 
834
850
    def _inventory_add_lines(self, inv_vf, revid, parents, lines):
835
851
        inv_vf.add_lines_with_ghosts(revid, parents, lines)
836
852
 
1003
1019
    _formats = {}
1004
1020
    """The known formats."""
1005
1021
 
 
1022
    def __str__(self):
 
1023
        return "<%s>" % self.__class__.__name__
 
1024
 
1006
1025
    @classmethod
1007
1026
    def find_format(klass, a_bzrdir):
1008
1027
        """Return the format for the repository object in a_bzrdir."""