`bzr clean-tree` should not blindly delete nested branch/tree/repo

Bug #572098 reported by Alexander Belchenko
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Alexander Belchenko
Nominated for Trunk by Alexander Belchenko
Alexander Belchenko
bzr (Ubuntu)

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
C:\Temp\1>bzr clean-tree
Are you sure you wish to delete these [y/N]?y
deleting paths:

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/tree/checkout/light checkout/shared repo and don't forgte about bzr-svn, bzr-git and so on.

Will attempt to open bzrdir will be enough? If not, what API I should use?

Related branches

Changed in bzr:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Alexander Belchenko (bialix)
Revision history for this message
Alexander Belchenko (bialix) wrote :

The fix is merged to lp:bzr, another patch (backport to 2.1) has to be merged soon as well.

Changed in bzr:
status: Confirmed → Fix Committed
Revision history for this message
Alexander Belchenko (bialix) wrote :

merged to lp:bzr and lp:bzr/2.1

Changed in bzr:
status: Fix Committed → Fix Released
milestone: none → 2.1.2
Changed in bzr:
milestone: 2.1.2 → 2.2b3
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Accepted bzr into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in bzr (Ubuntu Lucid):
status: New → Fix Committed
tags: added: verification-needed
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr - 2.1.4-0ubuntu1

bzr (2.1.4-0ubuntu1) lucid-proposed; urgency=low

  * Update watch file to use 2.1 series.
  * New upstream release.
   + Fix file descriptors leaks in dirstate compiled extension. LP: #583486
   + Refuse to stack on repositories in incompatible formats. LP: #562380
   + Don't delete nested trees/repos. LP: #572098
   + Fix 'bzr switch' crash when a 'ConfigurableFileMerger' is used. LP: #559436
   + Fix compatibility with older smart servers. LP: #528041
   + Fix symlinks addition. LP: #192859
   + Properly unversion children of unversioned directories. LP: #494221
   + Lock configuration files in '~/.bazaar' for updates. LP: #525571
   + Fix 'bzr commit <symlink>'. LP: #128562
   + Fix `lp:` urls when behind an http proxy. LP: #558343
   + Stop using edge.launchpad.net. LP: #583667
 -- Max Bowsher <email address hidden> Tue, 17 May 2011 09:54:17 +0100

Changed in bzr (Ubuntu Lucid):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers