~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-15 11:25:40 UTC
  • mfrom: (5436.2.9 hooks-refactoring)
  • mto: This revision was merged to the branch mainline in revision 5500.
  • Revision ID: v.ladeuil+lp@free.fr-20101015112540-vhgyone6ou1g0foo
Merge lp:~spiv/bzr/hooks-refactoring with tweaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    lockdir,
40
40
    lru_cache,
41
41
    osutils,
 
42
    pyutils,
42
43
    revision as _mod_revision,
43
44
    static_tuple,
44
45
    symbol_versioning,
52
53
from bzrlib.testament import Testament
53
54
""")
54
55
 
 
56
import sys
55
57
from bzrlib import (
56
58
    errors,
57
59
    registry,
2825
2827
            % (name, from_module),
2826
2828
            DeprecationWarning,
2827
2829
            stacklevel=2)
2828
 
        m = __import__(from_module, globals(), locals(), [name])
2829
2830
        try:
2830
 
            return getattr(m, name)
 
2831
            return pyutils.get_named_object(from_module, name)
2831
2832
        except AttributeError:
2832
2833
            raise AttributeError('module %s has no name %s'
2833
 
                    % (m, name))
 
2834
                    % (sys.modules[from_module], name))
2834
2835
    globals()[name] = _deprecated_repository_forwarder
2835
2836
 
2836
2837
for _name in [