[BUG] bzr.dev fails when 'rollover_trace_maybe'

John Arbash Meinel john at arbash-meinel.com
Sat Sep 22 23:09:22 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I just got this error:
% bzr --no-plugins st
    Traceback (most recent call last):
  File "/home/jameinel/bin/bzr", line 98, in <module>
    bzrlib.trace.enable_default_logging()
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/trace.py", line 218, in
enable_default_logging
    open_tracefile()
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/trace.py", line 177, in
open_tracefile
    _rollover_trace_maybe(_bzr_log_filename)
  File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/trace.py", line 154, in
_rollover_trace_maybe
    rename(trace_fname, old_fname)
NameError: global name 'rename' is not defined

I think one of the recent changes removed 'rename' from the local
namespace, so now it is failing to backup the old .bzr.log to .bzr.log.old.

I don't know what patch caused it, but this "fixes" it:
=== modified file 'bzrlib/trace.py'
- --- bzrlib/trace.py     2007-09-21 06:13:09 +0000
+++ bzrlib/trace.py     2007-09-22 22:07:51 +0000
@@ -151,7 +151,7 @@
         if size <= 4 << 20:
             return
         old_fname = trace_fname + '.old'
- -        rename(trace_fname, old_fname)
+        os.rename(trace_fname, old_fname)
     except OSError:
         return


It would seem that we need a test for our .bzr.log backup rules (it
should be rename after it gets about 4MB).

To test this, just fill .bzr.log with a bunch of random data:

dd if=/dev/random of=~/.bzr.log bs=1024 count=10240

That should cause us to try to backup the log to a log.old.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG9ZKSJdeBCYSNAAMRAuDcAJoDbw+OrfvlWStDecTCnlw+KYgmEwCgy2JD
BasaFHOXwbhVWCXBAg4My7g=
=Osl+
-----END PGP SIGNATURE-----



More information about the bazaar mailing list