switch does't work with empty branches
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
this may related to #82555
When I create some branches and switch between them, I get an unexpected behavior.
the sequence of commands to reproduce
$ bzr init master
Standalone tree (format: pack-0.92)
Location:
branch root: master
$ bzr branch master feature1
Branched 0 revision(s).
$ bzr branch master feature2
Branched 0 revision(s).
$ bzr co master working
$ cd working
$ touch file1.txt
$ bzr add && bzr commit -m "commit on master"
added file1.txt
Committing to: /home/alexandre
added file1.txt
Committed revision 1.
$ bzr switch feature1
Tree is up to date at revision 1.
Switched to branch: /home/alexandre
$ touch file2.txt
$ bzr add
added file2.txt
$ bzr commit -m "added file2 on feature 1"
bzr: ERROR: Bound branch BzrBranch6(
To commit to master branch, run update and then commit.
You can also pass --local to commit to continue working disconnected.
in fact when I switch to a branch that have 0 revisions my working seems to be not updated, but if I do a bzr status, I get nothing. if I do a ls, the files stay there... example:
$ bzr switch feature2 --force
Tree is up to date at revision 1.
Switched to branch: /home/alexandre
$ ls
file1.txt file2.txt
in this point since I switched to branch feature2 the files should "disappear", since branch feature2 have no files yet.
if I go now to the branch feature1 and feature2 and pull changes from master, then all works fine.
I also have a "feature request" related to this, since I can switch branches in the same parent directory of working copy, I would like to merge the branches in that way, because for now, if I want to merge branch feature1 into my working copy I need to do "bzr merge ../feature1", wich is not so hard but just "bzr merge feature1" is cleaner.
tags: | added: check-for-breezy |
I don't know that being able to switch to the NULL revision is necessary, but in the current state it does leave you in a confusing state.
Arguably 'bzr branch' of a NULL branch also shouldn't really work.