"switch -b" sets incorrect parent for heavyweight checkout
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Low
|
Dr Al |
Bug Description
From a user's point of view, a heavyweight checkout should operate like a lightweight checkout but with added benefits (faster operation over a network etc). Using a feature branch model with a light weight checkout, the parent branch of a new feature branch created by "switch -b" is the original feature branch. With a heavyweight checkout, the parent branch is incorrectly set as the checkout location.
For example:
###################
# SETUP (COMMON): #
###################
$ bzr init-repo --no-trees testproj
Shared repository (format: 2a)
Location:
shared repository: testproj
$ bzr init testproj/trunk
Created a repository branch (format: 2a)
Using shared repository: C:/al/testing/
###############
# LIGHTWEIGHT: #
###############
$ bzr co --lightweight testproj/trunk/ trlco
$ cd trlco
$ bzr switch -b feature-branch-lw
Tree is up to date at revision 0.
Switched to branch: C:/al/testing/
$ cd ..
$ bzr info testproj/
Repository branch (format: 2a)
Location:
shared repository: testproj
repository branch: testproj/
Related branches:
parent branch: testproj/trunk
# This is correct: parent branch is trunk
################
# HEAVYWEIGHT: #
################
$ bzr co testproj/trunk/ trhco
$ cd trhco
$ bzr switch -b feature-branch-hw
Tree is up to date at revision 0.
Switched to branch: C:/al/testing/
$ cd ..
$ bzr info testproj/
Repository branch (format: 2a)
Location:
shared repository: testproj
repository branch: testproj/
Related branches:
parent branch: trhco
# This is incorrect: the parent branch should be testproj/trunk
Related branches
- Vincent Ladeuil: Approve
-
Diff: 177 lines (+101/-4)5 files modifiedbzrlib/branch.py (+5/-1)
bzrlib/switch.py (+1/-0)
bzrlib/tests/blackbox/test_branch.py (+31/-0)
bzrlib/tests/blackbox/test_switch.py (+61/-3)
doc/en/release-notes/bzr-2.4.txt (+3/-0)
description: | updated |
Changed in bzr: | |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in bzr: | |
assignee: | nobody → Dr Al (abudden) |
status: | Confirmed → In Progress |
milestone: | none → 2.4b3 |
Changed in bzr: | |
status: | In Progress → Fix Released |
Would anyone be willing to mentor me on attempting to fix this bug? I'm really keen to see it sorted as it seriously affects the use of feature branches with bound-branches. However, I'm not really sure of where to start looking for the place in the code where the parent branch is set after a switch checkout.