Rev 3700: Make message optional, don't check the memory flag directly. in http://bzr.arbash-meinel.com/branches/bzr/1.8-dev/debug_memory

John Arbash Meinel john at arbash-meinel.com
Fri Sep 26 23:14:47 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.8-dev/debug_memory

------------------------------------------------------------
revno: 3700
revision-id: john at arbash-meinel.com-20080926221442-3r67j99sr9rwe9w0
parent: john at arbash-meinel.com-20080910181759-3f30at7qak0k6syx
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: debug_memory
timestamp: Fri 2008-09-26 17:14:42 -0500
message:
  Make message optional, don't check the memory flag directly.
-------------- next part --------------
=== modified file 'bzrlib/trace.py'
--- a/bzrlib/trace.py	2008-09-10 18:17:59 +0000
+++ b/bzrlib/trace.py	2008-09-26 22:14:42 +0000
@@ -390,10 +390,8 @@
 
 _short_fields = ('VmPeak', 'VmSize', 'VmRSS')
 
-def debug_memory(message, short=True):
+def debug_memory(message='', short=True):
     """Write out a memory dump."""
-    if 'memory' not in debug.debug_flags:
-        return
     try:
         status_file = file('/proc/%s/status' % os.getpid(), 'rb')
     except IOError:
@@ -402,7 +400,8 @@
         status = status_file.read()
     finally:
         status_file.close()
-    note(message)
+    if message:
+        note(message)
     for line in status.splitlines():
         if not short:
             note(line)



More information about the bazaar-commits mailing list