Wishlist: Option for qbzr - prevent checkouts into non-empty folders

Bug #938835 reported by André Bachmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
Medium
André Bachmann

Bug Description

Checkouts into non-empty folders are often a pain in the ass because of many occuring conflicts. Other VCS software tools are prohibiting this. I don't want to go this far, but offering an option to prevent this in qbzr might help some new VCS users to prevent headaches when solving these conflicts (as I experienced in my working environment...).

I'm willing to create this option for qbzr, but I can't say when there is time for it.

Related branches

Revision history for this message
Alexander Belchenko (bialix) wrote :

Please, explain how should this option work, in your opinion?

Changed in qbzr:
status: New → Incomplete
Revision history for this message
Alexander Belchenko (bialix) wrote :

Also, please note that this is not qbzr fault to allowing you shooting yourself in the foot, that's what bzr itself allowing to do. I'll add bzr to the bug report.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 938835] [NEW] Wishlist: Option for qbzr - prevent checkouts into non-empty folders

I was a bit surprised to see checkout (unlike branch) will populate an
existing non-empty non-bzr directory. We should probably make that
off by default.

--
Martin

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

I agree that this should be done rather on bzr level than with qbzr. But I thought there might be a reason why bzr doesn't prevent this - maybe I was wrong. So i came to the idea of an option to prevent this at least when using Bazaar Explorer with qbzr, because more inexperienced users will work with the Bazaar GUI, and I want to help them.

To be more specific, I have the idea that qgetnew should first check if the target location is empty - if not, it should show a warning and prevent this action (if the user has set the option to prevent checkouts to non-empty locations).

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 пишет:
> To be more specific, I have the idea that qgetnew should first check if
> the target location is empty - if not, it should show a warning and
> prevent this action (if the user has set the option to prevent checkouts
> to non-empty locations).

I think the simplest option would be: qgetnew will check if target is
empty and issue warning when it's not. Warning will have have 2 buttons:
"Do anyway" and "Cancel". That way we don't have to implement any new
options. What do you think?

--
All the dude wanted was his rug back

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

Sounds good and easy to implement. I will do so and keep you informed. :)

Revision history for this message
Alexander Belchenko (bialix) wrote :

André Bachmann пишет:
> Sounds good and easy to implement. I will do so and keep you informed.
> :)

"Easy" is the key to win ;-)

--
All the dude wanted was his rug back

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

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. :)

Revision history for this message
Alexander Belchenko (bialix) wrote :

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

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

Thanks for your input.
1) You are right, "Yes" and "No" is the more straight way for this question.
2) Thanks to this hint, now I understand finally that these methods like do_start from getnew.py (and other files as well) override the method stubs provided by subprocess.py. This shows one more time how useful a developer documentation would be. ;)
3) Ok, here I confused None with the empty list, fixed.

Revision history for this message
Alexander Belchenko (bialix) wrote :

André Bachmann пишет:
> 2) Thanks to this hint, now I understand finally that these methods like do_start from getnew.py (and other files as well) override the method stubs provided by subprocess.py. This shows one more time how useful a developer documentation would be. ;)

Yep, developer documentation is very good thing to have. But it requires
a time to write it. And we already have some sort of such documentation:
docstrings in our classes and "documentation by example" in the existing
code of other dialogs. And the last, I don't mind mentor people when
they ask.

--
All the dude wanted was his rug back

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

Well ok, time is really a problem, I also wish to have more of it.
Anyway, I pushed my branch to lp and a merge proposal is pending.

Changed in qbzr:
status: Incomplete → Fix Released
importance: Undecided → Medium
assignee: nobody → André Bachmann (andrebachmann-dd)
milestone: none → 0.22.2
Vincent Ladeuil (vila)
no longer affects: bzr
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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