~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Martin Pool
  • Date: 2006-08-14 04:09:45 UTC
  • mfrom: (1904.1.3 0.9)
  • mto: This revision was merged to the branch mainline in revision 1913.
  • Revision ID: mbp@sourcefrog.net-20060814040945-414f329d15cd8d58
[merge] changes from 0.9 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        zero_nine, 
41
41
        )
42
42
from bzrlib.testament import Testament
43
 
from bzrlib.trace import mutter, note
 
43
from bzrlib.trace import mutter, note, warning
44
44
from bzrlib.tsort import topo_sort
45
45
from bzrlib.weave import WeaveFile
46
46
 
47
47
 
 
48
# Old formats display a warning, but only once
 
49
_deprecation_warning_done = False
 
50
 
 
51
 
48
52
class Repository(object):
49
53
    """Repository holding history for one or more branches.
50
54
 
188
192
        self.control_weaves = control_store
189
193
        # TODO: make sure to construct the right store classes, etc, depending
190
194
        # on whether escaping is required.
 
195
        self._warn_if_deprecated()
191
196
 
192
197
    def __repr__(self):
193
198
        return '%s(%r)' % (self.__class__.__name__, 
680
685
        result.check()
681
686
        return result
682
687
 
 
688
    def _warn_if_deprecated(self):
 
689
        global _deprecation_warning_done
 
690
        if _deprecation_warning_done:
 
691
            return
 
692
        _deprecation_warning_done = True
 
693
        warning("Format %s for %s is deprecated - please use 'bzr upgrade' to get better performance"
 
694
                % (self._format, self.bzrdir.transport.base))
 
695
 
683
696
 
684
697
class AllInOneRepository(Repository):
685
698
    """Legacy support - the repository behaviour for all-in-one branches."""
792
805
                                                _revision_store,
793
806
                                                control_store,
794
807
                                                text_store)
795
 
 
796
808
        dir_mode = self.control_files._dir_mode
797
809
        file_mode = self.control_files._file_mode
798
810
 
827
839
class KnitRepository(MetaDirRepository):
828
840
    """Knit format repository."""
829
841
 
 
842
    def _warn_if_deprecated(self):
 
843
        # This class isn't deprecated
 
844
        pass
 
845
 
830
846
    def _inventory_add_lines(self, inv_vf, revid, parents, lines):
831
847
        inv_vf.add_lines_with_ghosts(revid, parents, lines)
832
848
 
999
1015
    _formats = {}
1000
1016
    """The known formats."""
1001
1017
 
 
1018
    def __str__(self):
 
1019
        return "<%s>" % self.__class__.__name__
 
1020
 
1002
1021
    @classmethod
1003
1022
    def find_format(klass, a_bzrdir):
1004
1023
        """Return the format for the repository object in a_bzrdir."""