Naming of .bzr.backup directory makes deleting .bzr easy

Bug #124325 reported by Mary Gardiner
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin Albisetti
Launchpad itself
Fix Released
High
Jonathan Lange

Bug Description

When a bzr repo is upgraded, the old version info is backed up to .bzr.backup.

When using tab completion to remove this directory though, "rm -rf .bzr.backup" has an unfortunate tendency to become "rm -rf .bzr", occasionally resulting in a user deleting their version control info rather than its backup copy.

There are two times when a user tends to delete .bzr.backup. The first is unproblematic: immediately after a successful repository upgrade. In this case, if .bzr is accidently deleted, the user can restore .bzr.backup to .bzr, re-upgrade and done. However, the second is on the *next* upgrade (if .bzr.backup is still around, the upgrade will fail and ask for .bzr.backup to be deleted) which could be after some considerable time and any number of changes: a bad time to delete .bzr by accident!

Suggested fix: the backup directory should not begin with .bzr.

Tags: lp-code
description: updated
Revision history for this message
Martin Pool (mbp) wrote :

That's a good point. Thankyou for the report, Mary.

What would be a better name? Should it still be dotted?

If you upgrade twice I suppose we should use a new and different name for the second one.

Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Mary Gardiner (puzzlement) wrote :

I am a defective namer, but possibly: .backup.bzr ? It's about equivalently easy to work out what it does, and doesn't begin with .bzr. I don't see any reason not to dot it, except that I suppose one could end up with a bunch of backup dirs taking up space in a repository. An upgrade could warn about old backups, or you could just assume that it's the user's responsibility to keep junk out of their repo.

In terms of keeping multiple backups, maybe .backup.bzr-[code for the format]-[revision number] or something like that?

Martin Albisetti (beuno)
Changed in bzr:
assignee: nobody → beuno
status: Triaged → In Progress
Revision history for this message
Jonathan Lange (jml) wrote :

Once this is in Bazaar, we'll need to update the codehosting whitelist to allow the new backup directory. This fix will be critical, but there's no point marking the bug that way until the patch lands in Bazaar.

Changed in launchpad-bazaar:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Tim Penhey (thumper) wrote :

I like the idea of encoding the revision number in the backup dir (although that only really makes sense for branches, not repos).

Adding the format could be useful if there is a short meaningful name that could be used (ie no spaces).

Revision history for this message
Martin Albisetti (beuno) wrote :

Patch has been merged, the backup dir will be: backup.bzr

Thanks for the report!

Changed in bzr:
status: In Progress → Fix Released
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 124325] Re: Naming of .bzr.backup directory makes deleting .bzr easy

On Wed, 2008-03-12 at 01:41 +0000, Jonathan Lange wrote:
> Once this is in Bazaar, we'll need to update the codehosting whitelist
> to allow the new backup directory. This fix will be critical, but
> there's no point marking the bug that way until the patch lands in
> Bazaar.

Why not allow it now?

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Tim Penhey (thumper) wrote :

Jono,

I believe this was fixed in the last release. Can you confirm?

Changed in launchpad-bazaar:
assignee: nobody → jml
Jonathan Lange (jml)
Changed in launchpad-bazaar:
status: Confirmed → Fix Released
Revision history for this message
John A Meinel (jameinel) wrote :

I can say that I was able to upgrade a branch, and that we do name the directory backup.bzr, so it seems to be working here.

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.