Rev 3549: (jam) Add extra debugging for when a deprecated function/method is in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Jul 17 03:35:07 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3549
revision-id:pqm at pqm.ubuntu.com-20080717023455-idnyms69oiauf7fh
parent: pqm at pqm.ubuntu.com-20080717021820-yezog2oydqnfnmy1
parent: john at arbash-meinel.com-20080717015002-uhhc7h8ssetsvm2c
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2008-07-17 03:34:55 +0100
message:
  (jam) Add extra debugging for when a deprecated function/method is
  	called
modified:
  bzrlib/symbol_versioning.py    symbol_versioning.py-20060105104851-9ecf8af605d15a80
    ------------------------------------------------------------
    revno: 3530.2.2
    revision-id:john at arbash-meinel.com-20080717015002-uhhc7h8ssetsvm2c
    parent: john at arbash-meinel.com-20080713164334-eu5xwg1046zxyz03
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: jam-integration
    timestamp: Wed 2008-07-16 20:50:02 -0500
    message:
      Add extra debugging for when a deprecated function/method are called
    modified:
      bzrlib/symbol_versioning.py    symbol_versioning.py-20060105104851-9ecf8af605d15a80
=== modified file 'bzrlib/symbol_versioning.py'
--- a/bzrlib/symbol_versioning.py	2008-05-28 23:20:33 +0000
+++ b/bzrlib/symbol_versioning.py	2008-07-17 01:50:02 +0000
@@ -138,6 +138,8 @@
         
         def decorated_function(*args, **kwargs):
             """This is the decorated function."""
+            from bzrlib import trace
+            trace.mutter_callsite(4, "Deprecated function called")
             warn(deprecation_string(callable, deprecation_version),
                 DeprecationWarning, stacklevel=2)
             return callable(*args, **kwargs)
@@ -164,6 +166,7 @@
         
         def decorated_method(self, *args, **kwargs):
             """This is the decorated method."""
+            from bzrlib import trace
             if callable.__name__ == '__init__':
                 symbol = "%s.%s" % (self.__class__.__module__,
                                     self.__class__.__name__,
@@ -173,6 +176,7 @@
                                        self.__class__.__name__,
                                        callable.__name__
                                        )
+            trace.mutter_callsite(4, "Deprecated method called")
             warn(deprecation_version % symbol, DeprecationWarning, stacklevel=2)
             return callable(self, *args, **kwargs)
         _populate_decorated(callable, deprecation_version, "method",




More information about the bazaar-commits mailing list