Comment 9 for bug 938835

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 938835] Re: Wishlist: Option for qbzr - prevent checkouts into non-empty folders

André Bachmann пишет:
> I linked my branch with an idea to solve this problem to this bug report.
> However, I'm not completely satisfied with it, because if you choose not to checkout, it lets the qgetnew window open with the only option to click 'Cancel'. I'm not yet sure how to make this more user-friendly. My idea was to reset this window to its starting state.
> I appreciate any suggestions. :)

Couple of suggestions:

1) If you're using question "Do you really want to checkout into a
non-empty folder?" then I think we should use buttons Yes / No, not OK /
Cancel. Because such question expect from people simple Ye/No answer. Do
you agree?

2) I suggest put this check into validate method. It should be much
better and it will show our intent more clearly.

3) I'm sure `os.listdir(...) is not None` is not right:

C:\Temp\3>dir
  Volume in drive C is XP
  Volume Serial Number is B47B-BD42

  Directory of C:\Temp\3

27.02.2012 12:22 <DIR> .
27.02.2012 12:22 <DIR> ..
                0 File(s) 0 bytes
                2 Dir(s) 2 744 070 144 bytes free

C:\Temp\3>python -c "import os; print os.listdir('.')"
[]

You should use just `os.listdir(...)` and it will be False if list is
empty, and True if there are some files.

--
All the dude wanted was his rug back