bzr switch -r switches revision but gives incorrect output

Bug #736107 reported by Jelmer Vernooij on 2011-03-16
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
High
Unassigned
Breezy
High
Jelmer Vernooij
bzr (Debian)
Confirmed
Unknown

Bug Description

~/src/grub-bzr$ bzr switch -r 2587
from debian bug 612987:

Updated to revision 3089.
Switched to branch: /home/josh/src/grub-bzr/

Checking bzr log shows all the revisions up to 3089, but looking carefully at
the actual working tree shows that it did switch to 2587.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/16/2011 2:21 PM, Jelmer Vernooij wrote:
> Public bug reported:
>
> ~/src/grub-bzr$ bzr switch -r 2587
> from debian bug 612987:
>
> Updated to revision 3089.
> Switched to branch: /home/josh/src/grub-bzr/
>
> Checking bzr log shows all the revisions up to 3089, but looking carefully at
> the actual working tree shows that it did switch to 2587.
>
> ** Affects: bzr
> Importance: High
> Status: Confirmed
>
>
> ** Tags: switch
>

log always shows the whole branch, rather than the WT's history. That
may be a different bug, but as long as the WT files are at 2587, *this*
bug seems invalid.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2AypoACgkQJdeBCYSNAAP0HQCgpDqAkjqPCe07nhLwuuecgNvB
+XEAn3GC8B1YWHDMYGHEKZrLmQSY4biI
=Xr5j
-----END PGP SIGNATURE-----

Changed in bzr (Debian):
status: Unknown → Confirmed
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.

Jelmer Vernooij (jelmer) on 2017-11-08
tags: added: check-for-breezy
Jelmer Vernooij (jelmer) on 2018-04-02
tags: added: colocated
removed: check-for-breezy
Changed in brz:
importance: Undecided → High
milestone: none → 3.0.0
Jelmer Vernooij (jelmer) on 2018-04-03
Changed in brz:
status: New → Triaged
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer) on 2018-11-17
Changed in brz:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.