switch does't work with empty branches

Bug #297768 reported by Alexandre
2
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/projetos/tmp/master/
added file1.txt
Committed revision 1.
$ bzr switch feature1
Tree is up to date at revision 1.
Switched to branch: /home/alexandre/projetos/tmp/feature1/
$ touch file2.txt
$ bzr add
added file2.txt
$ bzr commit -m "added file2 on feature 1"
bzr: ERROR: Bound branch BzrBranch6('file:///home/alexandre/projetos/tmp/working/') is out of date with master branch BzrBranch6('file:///home/alexandre/projetos/tmp/feature1/').
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/projetos/tmp/feature2/
$ 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.

Revision history for this message
John A Meinel (jameinel) wrote :

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.

Changed in bzr:
importance: Undecided → Wishlist
status: New → Confirmed
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.