Code review comment for lp:~andrebachmann-dd/qbzr/checkout_basedir

Revision history for this message
IWATA Hidetaka (hid-iwata) wrote :

Hi, thank you for reply.

> Ok, now to_location only gets the text from checkout_basedir if ui_mode is true. 'bzr qgetnew location' does work now.

Why ui_mode? I don't think ui_mode is good thing to switch this
behaivior. Now, 'bzr qgetnew' probably does not work as you expected.

I'd like to suggest you this fix. How about it?

1. cmd_qgetnew._qbzr_run
    Change default value of location to None, instead of CUR_DIR

2. GetNewWorkingTreeWindow.__init__
    Apply configuration if to_location is None.

=== modified file 'lib/commands.py'
--- lib/commands.py 2011-06-30 16:28:58 +0000
+++ lib/commands.py 2011-07-26 15:04:12 +0000
@@ -851,7 +851,7 @@
     takes_options = [ui_mode_option]
     aliases = ['qgetn']

- def _qbzr_run(self, location=CUR_DIR, ui_mode=False):
+ def _qbzr_run(self, location=None, ui_mode=False):
         from bzrlib.plugins.qbzr.lib.getnew import GetNewWorkingTreeWindow
         self.main_window = GetNewWorkingTreeWindow(location, ui_mode=ui_mode)
         self.main_window.show()

=== modified file 'lib/getnew.py'
--- lib/getnew.py 2011-07-25 13:23:12 +0000
+++ lib/getnew.py 2011-07-26 15:03:55 +0000
@@ -44,10 +44,9 @@
     branchsource_basedir = config.get_option("branchsource_basedir")

     def __init__(self, to_location, ui_mode=True, parent=None):
- if ui_mode and self.checkout_basedir is not None:
- self.to_location = os.path.abspath(self.checkout_basedir)
- else:
- self.to_location = os.path.abspath(to_location)
+ if not to_location:
+ to_location = self.checkout_basedir or u'.'
+ self.to_location = os.path.abspath(to_location)

         super(GetNewWorkingTreeWindow, self).__init__(
                                   name = self.NAME,

« Back to merge proposal