bzr switch should have a -r option

Bug #183559 reported by Jelmer Vernooij
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Andrew Bennetts
Nominated for 2.1 by Aliaksei Vasileuski

Bug Description

  affects bzr

bzr switch should have a -r option to allow switching the current branch
to a custom revision.

--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Related branches

Revision history for this message
Matthew Fuller (fullermd) wrote :

I think of that more as "bzr update should have a -r option".

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 183559] Re: bzr switch should have a -r option

Am Mittwoch, den 16.01.2008, 21:04 +0000 schrieb fullermd:
> I think of that more as "bzr update should have a -r option".
It may involve switching to a completely different branch, in which
 case I think the name "update" is confusing.
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
Matthew Fuller (fullermd) wrote :

> It may involve switching to a completely different branch, in which
> case I think the name "update" is confusing.

Oh, I see. Carry on.

--
Matthew Fuller (MF4839) | <email address hidden>
Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.

Revision history for this message
Miguel González Cuadrado (mgcuadrado) wrote :

I have seen discussions about this functionality being achievable by a combination of "merge" and "revert", but I think these discussions miss the point: the point of having "switch -r" is to be able to safely make experiments with time travel and parallel universes to see the effect of current changes or the point at which something breaks, then come back safely to the present current state.

I have only used CVS before, and I really miss this feature when investigating bugs; it makes it almost monkey-trivial to narrow new bugs to a single revision; and if revisions are sufficiently atomic, bugs become obvious.

Or I may be missing some point myself...

Dan Watkins (oddbloke)
Changed in bzr:
assignee: nobody → daniel-thewatkins
status: New → In Progress
Dan Watkins (oddbloke)
Changed in bzr:
status: In Progress → Fix Committed
Revision history for this message
Vincent Ladeuil (vila) wrote :

@Daniel, did you submit this patch ?

Revision history for this message
Max Bowsher (maxb) wrote :

It has just occurred to me that for the case of an unbound branch, "bzr pull --overwrite -r X" approximates quite closely to the desired outcome.

Revision history for this message
Miguel González Cuadrado (mgcuadrado) wrote :

@Max Bowsher, Re: "bzr pull --overwrite -r X"

... but then you would sacrifice your non-committed changes.

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

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

Miguel González Cuadrado wrote:
> @Max Bowsher, Re: "bzr pull --overwrite -r X"
>
> ... but then you would sacrifice your non-committed changes.
>

Actually you don't. "pull --overwrite" merges the changes for the
committed revisions, and brings across the uncommitted stuff.

John
=:->

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

iEYEARECAAYFAkrzt6cACgkQJdeBCYSNAAPmeACdHqJm25psp2+OYVuaxD4htmx3
dosAmQFj4apnx8ftGw2OmMXx33adYlKk
=2Ezc
-----END PGP SIGNATURE-----

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

John A Meinel wrote:
> Miguel González Cuadrado wrote:
>> @Max Bowsher, Re: "bzr pull --overwrite -r X"
>
>> ... but then you would sacrifice your non-committed changes.
>
>
> Actually you don't. "pull --overwrite" merges the changes for the
> committed revisions, and brings across the uncommitted stuff.

Really?

Ian C.

Revision history for this message
Aliaksei Vasileuski (sagara1337) wrote :

"update -r" should change working tree. Branch is intact.
How about "switch -r"? It should update branch & working tree?!

Revision history for this message
Aliaksei Vasileuski (sagara1337) wrote :

@Max Bowsher, Re: "bzr pull --overwrite -r X"

I searched for "update -r" or "git dissect" analogs and found yours "bzr pull --overwrite -r X".

Sad, sad day for me... Very sad...
It destroyed my last changes.

I "bzr pull --overwrite -r X" to update just working tree 10 revisions back. And know I cannot get them back!

I suspect they are completely destroed, is it correct?! I have only one local branch for my (freelance) project.
Please tell me, it my project can be recovered?!

Revision history for this message
Martin Pool (mbp) wrote :

2009/11/17 Nishi <email address hidden>:
> @Max Bowsher, Re: "bzr pull --overwrite -r X"
>
> I searched for "update -r" or "git dissect" analogs and found yours "bzr
> pull --overwrite -r X".
>
> Sad, sad day for me... Very sad...
> It destroyed my last changes.
>
> I "bzr pull --overwrite -r X" to update just working tree 10 revisions
> back. And know I cannot get them back!
>
> I suspect they are completely destroed, is it correct?! I have only one local branch for my (freelance) project.
> Please tell me, it my project can be recovered?!

Running 'bzr heads' (from the bzrtools plugin) will tell you about
unrerefenced revisions; you can then revert to one of them using "bzr
pull -r revid:...." from that list.

Sorry for the trouble.

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Aliaksei Vasileuski (sagara1337) wrote :

'bzr heads' shows nothing, i tried it already.

Revision history for this message
Martin von Gagern (gagern) wrote :

Nishi wrote:
> I suspect they are completely destroed, is it correct?!
> Please tell me, it my project can be recovered?!

The information should still be present in the repository. In a simple
test setup, I could recover such information in the following way:

$ bzr heads --dead-only
$ bzr pull --overwrite -r revid:<revid-of-dead-head> .

As you have noticed, this pull will change the branch as well as the
working copy. One more reason I want a tool working on the working tree
only, leaving the branch alone.

Revision history for this message
Martin Pool (mbp) wrote :

2009/11/17 Nishi <email address hidden>:
> 'bzr heads' shows nothing, i tried it already.

heads --all?

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Aliaksei Vasileuski (sagara1337) wrote :

Thank you for your help! I got 10 tips for each commit missing and also a tip for each uncommit, total ~20 tips. I just searched for the latest and restored it with 'bzr pull --overwrite -r revid:<revid-of-dead-head>'

Revision history for this message
methane (songofacandy) wrote :

Can this fix be merged to 2.1?

Revision history for this message
Per Johansson (per.j) wrote :

I believe the status for this bug is wrong? "Fix commited" to me says it's on the project main trunk, which is not true in this case, as far as I'm aware.

Revision history for this message
Andrew Bennetts (spiv) wrote :

The status is correct.

We use "Fix Committed" to mean "A fix for this bug exists in a branch somewhere": <http://doc.bazaar.canonical.com/developers/bug-handling.html#bug-status>.

Revision history for this message
Martin Pool (mbp) wrote :

@Nishi, this can be in 2.1 if someone finishes and reviews the branch in the next few weeks.

Daniel has not been around much for a while so I'm going to unassign it from him and put the branch up for review.

Changed in bzr:
status: Fix Committed → In Progress
assignee: Daniel Watkins (daniel-thewatkins) → nobody
Revision history for this message
Martin Pool (mbp) wrote :
Revision history for this message
Andrew Bennetts (spiv) wrote :

I'm the patch pilot this week, and John's pointed out that there's a half-finished patch here, so assigning this to me.

Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
Revision history for this message
Andrew Bennetts (spiv) wrote :

Fixed in lp;bzr r4964

Changed in bzr:
importance: Undecided → Medium
milestone: none → 2.1.0rc1
status: In Progress → Fix Released
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.