Merge lp:~vila/qbzr/config-get-filename-deleted into lp:qbzr

Proposed by Vincent Ladeuil
Status: Rejected
Rejected by: Gary van der Merwe
Proposed branch: lp:~vila/qbzr/config-get-filename-deleted
Merge into: lp:qbzr
Diff against target: 19 lines (+1/-5)
1 file modified
lib/util.py (+1/-5)
To merge this branch: bzr merge lp:~vila/qbzr/config-get-filename-deleted
Reviewer Review Type Date Requested Status
Gary van der Merwe Needs Fixing
Review via email: mp+34095@code.launchpad.net

Description of the change

This should fix the use of _get_filename() in lib/util.py

This method has been deleted from bzr.dev but the proposed version should
still work for bzr-2.2.

I just encountered this while working on more urgent stuff and wanted to give
feeedback asap.

To post a comment you must log in.
Revision history for this message
Gary van der Merwe (garyvdm) wrote :

Thanks for the patch.

I did a user test with both 2.2 and bzr.dev, and it works for both.

But when I run the test suit with 2.2, I get this error, in 5 different tests: (I don't get the errors when I run the test suit with bzr.dev)
======================================================================
ERROR: bzrlib.plugins.qbzr.lib.tests.test_log.TestLog.test_just_show_log_simple_commit
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/garyvdm/qbzr/trunk/lib/util.py", line 334, in closeEvent
    self.saveSize()
  File "/home/garyvdm/qbzr/trunk/lib/util.py", line 282, in saveSize
    config.set_user_option(name + "_window_size", "%dx%d" % size)
  File "/home/garyvdm/qbzr/trunk/lib/util.py", line 228, in set_user_option
    self._write_config_file()
  File "/usr/lib/python2.6/dist-packages/bzrlib/config.py", line 483, in _write_config_file
    atomic_file = atomicfile.AtomicFile(filename)
  File "/usr/lib/python2.6/dist-packages/bzrlib/atomicfile.py", line 75, in __init__
    self._fd = os.open(self.tmpfilename, flags, local_mode)
OSError: [Errno 2] No such file or directory: '/tmp/testbzr-oUnF5j.tmp/bzrlib.plugins.qbzr.lib.tests.test_log.TestLog.test_just_show_log_simple_commit/home/.bazaar/qbzr.conf.7129.garyvdm-desktop.di9b8xq1o1.tmp'

----------------------------------------------------------------------

I'll have to take a look why after work today.

review: Needs Fixing
Revision history for this message
Gary van der Merwe (garyvdm) wrote :

I discovered that we had 2 classes that write to qbzr.conf, as well as a number of other issues with our config code. I've removed the class that this patch adjusts, so this is no longer needed.

Unmerged revisions

1287. By Vincent Ladeuil

Stop-gap fix, _get_filename() doesn't exist anymore.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/util.py'
2--- lib/util.py 2010-05-25 11:45:52 +0000
3+++ lib/util.py 2010-08-30 16:53:29 +0000
4@@ -222,14 +222,10 @@
5
6 def set_user_option(self, option, value):
7 """Save option and its value in the configuration."""
8- conf_dir = os.path.dirname(self._get_filename())
9- ensure_config_dir_exists(conf_dir)
10 if 'DEFAULT' not in self._get_parser():
11 self._get_parser()['DEFAULT'] = {}
12 self._get_parser()['DEFAULT'][option] = value
13- f = open(self._get_filename(), 'wb')
14- self._get_parser().write(f)
15- f.close()
16+ self._write_config_file()
17
18
19 class _QBzrWindowBase(object):

Subscribers

People subscribed via source and target branches