Heavy checkouts don't inherit nick
Bug #148030 reported by
Matthew Fuller
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Unassigned |
Bug Description
When creating a checkout, you're creating a working tree for a branch. You shouldn't get a new nick. Lightweight checkouts work properly, but heavy don't:
#!/bin/sh
bzr="/usr/
# Initial branch
${bzr} init A
(
cd A ;
touch a ;
${bzr} add --quiet;
${bzr} ci --quiet -m 'add A'
)
# Make heavy and light checkouts
${bzr} checkout --quiet A heavy
${bzr} checkout --quiet --lightweight A light
# Show nicks
for i in A heavy light; do
nick=`(cd ${i} && bzr nick)`
printf "%6s %s\n" ${i} ${nick}
done
Changed in bzr: | |
status: | Triaged → Confirmed |
tags: | added: bound-branch nick |
Changed in bzr: | |
importance: | Medium → High |
To post a comment you must log in.
This "works" for lightweight because the nick is based on the branch path. Lightweight checkouts don't have another branch, and thus the only nick they can have is from the source.
Heavy checkouts have a local branch, and thus are defaulting to use it.
This could be fixed with just a check in Branch. _get_nick/ _set_nick to see if they are bound to another branch first.
I'm a little hesitant, because the way it is written requires actually connecting to the remote branch. get_master_ branch( ) doesn't cache the master branch, so it is another full round trip (with another SSH connection opened, etc).
And Branch.
Further, what do you do if there *is* something set in the local branch.conf file? Just ignore it when you are bound and then use it when you are not?
Anyway, it can be argued that this is a feature, and not a bug. Since you did name the checkout something locally. But I can say that I have no use for this feature. (I always name my checkouts the same as the upstream).
Actually, I take that back, my repository sometimes looks like:
repo/dev/0.7
And my checkout becomes
work/dev-0.7/
So that when I commit I get the full "dev-0.7" rather than just "0.7".
Anyway, I would live either way, this should probably become a list discussion.