qrevert: press OK without selecting files: got traceback

Bug #942744 reported by Alexander Belchenko
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
Medium
Alexander Belchenko

Bug Description

André Bachmann wrote:

Yesterday, a co-worker reported a slight problem with qrevert: If you
open Bazaar, Work, Revert Working Tree... and click OK without doing
anything, you get a BzrCommandError (as it is raised in revert.py in
the function validate). Well, such a message isn't quite user-
friendly. Turning this in to a nicer QtGui.QMessageBox.warning and
returning False isn't a problem. I have changed

raise errors.BzrCommandError("You have not selected anything to
revert.")

to

warningbox = QtGui.QMessageBox.warning(self, self.windowTitle(),
gettext("You have not selected anything to revert."))
return False

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

We should have appropriate check in validate method to prevent action to start.

Related branches

description: updated
Changed in qbzr:
assignee: nobody → Alexander Belchenko (bialix)
status: Confirmed → Fix Committed
milestone: none → 0.23beta1
Revision history for this message
André Bachmann (andrebachmann-dd) wrote :

I had the time to change the validate method of qrevert - now it shows a warning if the user wants to revert without selecting files.
The check if there are files selected to revert also now does a real check.
Please check my branch and tell me your opinion about it.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 942744] Re: qrevert: press OK without selecting files: got traceback

André Bachmann пишет:
> I had the time to change the validate method of qrevert - now it shows a warning if the user wants to revert without selecting files.
> The check if there are files selected to revert also now does a real check.
> Please check my branch and tell me your opinion about it.

Your branch has dropped a very important check for pending merges:

if (not self.has_pending_merges or not self.merges_groupbox.isChecked())

which is not right. The check for actually selected files instead of
"select all" is right for me.

--
All the dude wanted was his rug back

Revision history for this message
André Bachmann (andrebachmann-dd) wrote :

You are right, I had the same thought yesterday night right before sleeping. I will change that immediately.

Changed in qbzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.