`bzr clean-tree` should not blindly delete nested branch/tree/repo
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Alexander Belchenko | ||
2.1 |
Fix Released
|
High
|
Alexander Belchenko | ||
bzr (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Lucid |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
C:\Temp\1>bzr init .
Created a standalone tree (format: 1.9)
C:\Temp\1>bzr init foo
Created a standalone tree (format: 1.9)
C:\Temp\1>bzr st
unknown:
foo/
C:\Temp\1>bzr clean-tree
foo
Are you sure you wish to delete these [y/N]?y
deleting paths:
foo
I don't think it's the right behavior. I'd even call it dangerous behavior. Currently I've forced to stop using clean-tree command at all, because it affects both scmproj and bzr-externals plugins.
I think it will be better to add another command-line flags, e.g. --nested, to enable deleting of nested bzr objects.
I'd like to fix this, but I need some guidance on how reliable check that some given path is actually branch/
Will attempt to open bzrdir will be enough? If not, what API I should use?
Related branches
- Parth Malwankar: Approve
- Vincent Ladeuil: Approve
- Aaron Bentley: Pending requested
-
Diff: 100 lines (+45/-0)3 files modifiedNEWS (+4/-0)
bzrlib/clean_tree.py (+25/-0)
bzrlib/tests/blackbox/test_clean_tree.py (+16/-0)
- Vincent Ladeuil: Approve
-
Diff: 100 lines (+45/-0)3 files modifiedNEWS (+4/-0)
bzrlib/clean_tree.py (+25/-0)
bzrlib/tests/blackbox/test_clean_tree.py (+16/-0)
Changed in bzr: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Alexander Belchenko (bialix) |
Changed in bzr: | |
milestone: | 2.1.2 → 2.2b3 |
Changed in bzr (Ubuntu): | |
status: | New → Fix Released |
The fix is merged to lp:bzr, another patch (backport to 2.1) has to be merged soon as well.