"bzr rmbranch" doesn't handle colocated branches

Bug #920653 reported by Jelmer Vernooij on 2012-01-23
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Medium
Jelmer Vernooij
2.5
Medium
Unassigned
bzr (Ubuntu)
Medium
Jelmer Vernooij
Precise
Medium
Jelmer Vernooij

Bug Description

Reported by Aaron on the list:

On 12-01-23 10:12 AM, Jelmer Vernooij wrote:
>> It actually just seems to be in the 2.5 branch at the moment,
>> I'll up-merge that into bzr.dev as well.

With 2.5, it rmbranch appears to delete the wrong branch:

$ alias bzr=~/hacking/bzr/2.5/bzr
$ bzr init --development-colo foo
Created a standalone tree (format: development-colo)

$ cd foo
$ bzr branches
* (default)
$ bzr switch -b first-colo-branch
Tree is up to date at revision 0.

Switched to branch: /home/abentley/launchpad/foo/
$ bzr switch -b second-colo-branch
Tree is up to date at revision 0.

Switched to branch: /home/abentley/launchpad/foo/
$ bzr branches
  first-colo-branch
* second-colo-branch
$ bzr switch first-colo-branch
Tree is up to date at revision 0.
Switched to branch: /home/abentley/launchpad/foo/
$ bzr rmbranch second-colo-branch
$ bzr branches
  second-colo-branch

Related branches

Aaron Bentley (abentley) wrote :

With bzr.dev revno 6460, rmbranch doesn't remove the branch, just the asterisk:

$ bzr branches
  first-colo-branch
* second-colo-branch
$ bzr switch first-colo-branch
Tree is up to date at revision 0.
Switched to branch: /home/abentley/sandbox/foo/
$ bzr rmbranch second-colo-branch
$ bzr branches
  first-colo-branch
  second-colo-branch

On 02/02/2012 09:29 PM, Aaron Bentley wrote:
> With bzr.dev revno 6460, rmbranch doesn't remove the branch, just the
> asterisk:
>
> $ bzr branches
> first-colo-branch
> * second-colo-branch
> $ bzr switch first-colo-branch
> Tree is up to date at revision 0.
> Switched to branch: /home/abentley/sandbox/foo/
> $ bzr rmbranch second-colo-branch
> $ bzr branches
> first-colo-branch
> second-colo-branch
rmbranch calls "BzrDir.open_containing". That resolves to
$PWD/second-colo-branch. second-colo-branch isn't a branch, so $PWD is
opened. And then $PWD (.bzr/branch) gets removed, which is what causes
the asterisk to go away.

Cheers,

Jelmer

Jelmer Vernooij (jelmer) on 2012-02-23
Changed in bzr:
status: Confirmed → In Progress
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 2.5.0
Vincent Ladeuil (vila) on 2012-02-24
Changed in bzr:
milestone: 2.5.0 → none
Vincent Ladeuil (vila) on 2012-03-15
Changed in bzr:
milestone: none → 2.6b1
status: In Progress → Fix Released
Jelmer Vernooij (jelmer) on 2012-05-28
Changed in bzr (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu Precise):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Jelmer Vernooij (jelmer)

Hello Jelmer, or anyone else affected,

Accepted bzr into precise-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 Precise):
status: In Progress → Fix Committed
tags: added: verification-needed

I can confirm that the version in precise-proposed resolves this issue. Successful test case below:

andrew@andrew-laptop:~/Desktop$ bzr init --development-colo foo
Created a standalone tree (format: development-colo)
andrew@andrew-laptop:~/Desktop$ cd foo
andrew@andrew-laptop:~/Desktop/foo$ bzr branches
* (default)
andrew@andrew-laptop:~/Desktop/foo$ bzr switch -b first-colo-branch
Tree is up to date at revision 0.
Switched to branch: /home/andrew/Desktop/foo/
andrew@andrew-laptop:~/Desktop/foo$ bzr switch -b second-colo-branch
Tree is up to date at revision 0.
Switched to branch: /home/andrew/Desktop/foo/
andrew@andrew-laptop:~/Desktop/foo$ bzr branches
  first-colo-branch
* second-colo-branch
andrew@andrew-laptop:~/Desktop/foo$ bzr switch first-colo-branch
Tree is up to date at revision 0.
Switched to branch: /home/andrew/Desktop/foo/
andrew@andrew-laptop:~/Desktop/foo$ bzr rmbranch second-colo-branch
andrew@andrew-laptop:~/Desktop/foo$ bzr branches
* first-colo-branch

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

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

---------------
bzr (2.5.1-0ubuntu1) precise-proposed; urgency=low

  * New upstream release.
   + Fixes handling of colocated branches in `bzr rmbranch`. LP: #920653
   + rmbranch now refuses to remove active branch. LP: #922953
   + Connecting with HTTPS via HTTP correctly uses host name of destination
     rather than that of proxy. LP: #944696
   + No longer requires tty when GPG signing commits. LP: #847388
   + Fixes unicode erorrs when translated progress task messages
     contain non-ascii text. LP: #966934
   + Fixes display of help for configuration options that overlap
     with other topics. LP: #941672
  * Drop 06_spurious_test_failure: applied upstream.
 -- Jelmer Vernooij <email address hidden> Mon, 28 May 2012 13:36:02 +0200

Changed in bzr (Ubuntu Precise):
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