checkout in base directory does not honor -r

Bug #127708 reported by Robert Widhopf-Fenk
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Aaron Bentley

Bug Description

I just tried to find a bug using manual bisect on the history, unfortunately there is still no "bzr update -r REVNO" (like in SVN ;-), so I did a "bzr remove-tree; bzr checkout -r REVNO", but the bug was still there ... after some while I noticed that my checkouts always were the head revision, regardless of the revision number I was giving to checkout. It works if I checkout to another directory, but not within the ?base? directory of a branch ...

This is BZR revision: 2648 of bzr.dev and can be reproduced as follows:

mkdir test
cd test
bzr init
echo a >> s
bzr add s
bzr commit -m a
echo b >> s
bzr commit -m b

bzr remove-tree

bzr checkout -r 1
echo "s is wrong now, it is rev 2 instead of 1!"
cat s

bzr checkout -r 1 . good
echo "good/s is correct, it is rev 1"
cat good/s

Revision history for this message
Robert Widhopf-Fenk (hack-robf) wrote :

Found a typo while reading the docs on checkout ...

=== modified file 'bzrlib/help_topics.py'
--- bzrlib/help_topics.py 2007-07-12 12:07:13 +0000
+++ bzrlib/help_topics.py 2007-07-23 11:55:57 +0000
@@ -248,7 +248,7 @@
 that modify the revision history (as only one copy branch needs to be updated).
 Heavyweight checkouts will generally be faster for any command that uses the
 history but does not change it, but if the master branch is on the same disk
-then there wont be a noticeable difference.
+then there won't be a noticeable difference.

 Another possible use for a checkout is to use it with a treeless repository
 containing your branches, where you maintain only one working tree by

Aaron Bentley (abentley)
Changed in bzr:
assignee: nobody → aaron-bentley
status: New → Fix Released
Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 127708] checkout in base directory does not honor -r

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

Robert Widhopf-Fenk wrote:
> I just tried to find a bug using manual bisect on the history,
> unfortunately there is still no "bzr update -r REVNO"

I find that revert -r works well for this purpose.

Aaron

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpScq0F+nu1YWqI0RAn1JAJ92Vf7AfyCTYvZxzIA+xM7Ri3Q0GACfTL79
kKM/UAlkXv6e0COhPNjZjDM=
=6gEi
-----END PGP SIGNATURE-----

Revision history for this message
Robert Widhopf-Fenk (hack-robf) wrote :

I prefer to update to the old revision, then fix the bug there, update to head again, test the fix again and then commit to the head ... well this is how I do it in SVN.

With BZR I can checkout the old version make my fix and save them with shelve, update to head ...

If I use "revert" diff will not only show the fix, but also all reverted changes.

IMHO using "revert" for this purpose is abuse.

I really like "svn update -r REVNO" for this purpose and I do not want to change or delete+recreate my working directory for this purpose since the crappy IDE I am forced to use does not like things like these and there are also other files there which I do not want to delete or checkin.

Is it a design problem in BZR why "update -r" does not exist or "checkout -r" in the base directory of a branch does not work?

IMHO it should be possible that the working tree in the base directory of a branch has a different revno than the branch.
"missing" should show what changes the working tree is missing.

Robert.

Revision history for this message
Robert Widhopf-Fenk (hack-robf) wrote :

"bzr checkout --lightweight -r REVNO" ... will also ignore the -r.

BZR either should tell me that it is not possible to do this with lightweighted or in branch checkouts or honor the -r.

Robert.

Revision history for this message
Robert Collins (lifeless) wrote :

On Mon, 2007-07-23 at 22:09 +0000, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robert Widhopf-Fenk wrote:
> > I just tried to find a bug using manual bisect on the history,
> > unfortunately there is still no "bzr update -r REVNO"
>
> I find that revert -r works well for this purpose.

The difference is that update will preserve local changes - but I agree
that isolating a bug via revert -r bisection is reasonably easy.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

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.