[Pkg-bazaar-commits] ./bzr/unstable r60: put little explanation at top of bzr.log

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:27:04 UTC 2009


------------------------------------------------------------
revno: 60
committer: mbp at sourcefrog.net
timestamp: Tue 2005-03-22 12:17:00 +1100
message:
  put little explanation at top of bzr.log
modified:
  bzrlib/trace.py
-------------- next part --------------
=== modified file 'bzrlib/trace.py'
--- a/bzrlib/trace.py	2005-03-22 00:37:17 +0000
+++ b/bzrlib/trace.py	2005-03-22 01:17:00 +0000
@@ -20,7 +20,7 @@
 __author__ = "Martin Pool <mbp at canonical.com>"
 
 
-import sys, os, time, socket
+import sys, os, time, socket, stat
 import bzrlib
 
 ######################################################################
@@ -77,8 +77,16 @@
     _starttime = os.times()[4]
 
     _tracefile = file('.bzr.log', 'at')
-
     t = _tracefile
+
+    if os.fstat(t.fileno())[stat.ST_SIZE] == 0:
+        t.write("\nthis is a debug log for diagnosing/reporting problems in bzr\n")
+        t.write("you can delete or truncate this file, or include sections in\n")
+        t.write("bug reports to bazaar-ng at lists.canonical.com\n\n")
+
+    # TODO: If we failed to create the file, perhaps give a warning
+    # but don't abort; send things to /dev/null instead?
+
     
     t.write('-' * 60 + '\n')
     t.write('bzr invoked at %s\n' % bzrlib.osutils.format_date(time.time()))



More information about the Pkg-bazaar-commits mailing list