~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/symbol_versioning.py

Move working tree initialisation out from  Branch.initialize, deprecated Branch.initialize to Branch.create.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
           'deprecated_nonce',
26
26
           'deprecated_passed',
27
27
           'warn', 'set_warning_method', 'zero_seven',
 
28
           'zero_eight',
28
29
           ]
29
30
 
30
31
from warnings import warn
32
33
 
33
34
deprecated_nonce = "A deprecated parameter marker."
34
35
zero_seven = "%s was deprecated in version 0.7."
 
36
zero_eight = "%s was deprecated in version 0.8."
35
37
 
36
38
 
37
39
def set_warning_method(method):
59
61
            symbol = "%s.%s" % (callable.__module__, 
60
62
                                callable.__name__
61
63
                                )
62
 
            warn(deprecation_version % symbol, DeprecationWarning)
 
64
            warn(deprecation_version % symbol, DeprecationWarning, stacklevel=2)
63
65
            return callable(*args, **kwargs)
64
66
        _populate_decorated(callable, deprecation_version, "function",
65
67
                            decorated_function)
82
84
                                   self.__class__.__name__,
83
85
                                   callable.__name__
84
86
                                   )
85
 
            warn(deprecation_version % symbol, DeprecationWarning)
 
87
            warn(deprecation_version % symbol, DeprecationWarning, stacklevel=2)
86
88
            return callable(self, *args, **kwargs)
87
89
        _populate_decorated(callable, deprecation_version, "method",
88
90
                            decorated_method)