Comment 2 for bug 736107

Revision history for this message
Maciej Katafiasz (mathrick) wrote :

This actually interacts very badly with -b, which is a really, really important thing to get right for collocated branches:

mathrick@megumi /tmp/switch $ bzr init branch
mathrick@megumi /tmp/switch $ bzr checkout branch/ checkout
mathrick@megumi /tmp/switch $ cd checkout/
Created a standalone tree (format: 2a)
mathrick@megumi /tmp/switch $ cd branch/
mathrick@megumi /tmp/switch/checkout $ touch file.txt && bzr add && bzr ci -m "Initial"
[...]
Committed revision 1.
mathrick@megumi /tmp/switch/checkout $ for i in `seq 4`; do echo "base $i" >> file.txt; bzr ci -m "Base commit $i"; done
[...]
Committed revision 5.
mathrick@megumi /tmp/switch/checkout $ for i in `seq 3`; do echo "Feature $i" >> file.txt; bzr ci -m "Feature commit $i"; done
[...]
Committed revision 8.

###############
# Oops, forgot to make a "master" branch to rebase feature branches onto
mathrick@megumi /tmp/switch/checkout $ bzr switch -b master -r 5
Updated to revision 8.
Switched to branch: /tmp/switch/master/
###############
# This is completely wrong, and I really wouldn't expect it to have modified the WT instead
mathrick@megumi /tmp/switch/checkout $ bzr st
modified:
  file.txt

In this case, not honouring -r is definitely a bug -- I wanted to make a branch of r5, but I got r8 which I now have to uncommit. Either way, bzr switch's docs don't make any mention of this behaviour, which is far from the obvious interpretation of the standard "see revisionspec" help blurb.