~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-01-11 17:45:11 UTC
  • mfrom: (5582.4.1 remove-delegates)
  • Revision ID: pqm@pqm.ubuntu.com-20110111174511-6q6axq59ve3splyw
(vila) Remove backwards compatibility delegates deprecated since bzr 0.15.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2822
2822
        raise NotImplementedError(self.revision_graph_can_have_wrong_parents)
2823
2823
 
2824
2824
 
2825
 
# remove these delegates a while after bzr 0.15
2826
 
def __make_delegated(name, from_module):
2827
 
    def _deprecated_repository_forwarder():
2828
 
        symbol_versioning.warn('%s moved to %s in bzr 0.15'
2829
 
            % (name, from_module),
2830
 
            DeprecationWarning,
2831
 
            stacklevel=2)
2832
 
        try:
2833
 
            return pyutils.get_named_object(from_module, name)
2834
 
        except AttributeError:
2835
 
            raise AttributeError('module %s has no name %s'
2836
 
                    % (sys.modules[from_module], name))
2837
 
    globals()[name] = _deprecated_repository_forwarder
2838
 
 
2839
 
for _name in [
2840
 
        'AllInOneRepository',
2841
 
        'WeaveMetaDirRepository',
2842
 
        'PreSplitOutRepositoryFormat',
2843
 
        'RepositoryFormat4',
2844
 
        'RepositoryFormat5',
2845
 
        'RepositoryFormat6',
2846
 
        'RepositoryFormat7',
2847
 
        ]:
2848
 
    __make_delegated(_name, 'bzrlib.repofmt.weaverepo')
2849
 
 
2850
 
for _name in [
2851
 
        'KnitRepository',
2852
 
        'RepositoryFormatKnit',
2853
 
        'RepositoryFormatKnit1',
2854
 
        ]:
2855
 
    __make_delegated(_name, 'bzrlib.repofmt.knitrepo')
2856
 
 
2857
 
 
2858
2825
def install_revision(repository, rev, revision_tree):
2859
2826
    """Install all revision data into a repository."""
2860
2827
    install_revisions(repository, [(rev, revision_tree, None)])