Check current version after revert

Asked by Anders Sneckenborg

Is there any way to fint out which version is "active" after I have done revert?

/Anders

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Marius Kruger (amanica) said :
#1

I'd use `bzr revno` or `bzr log`

Revision history for this message
Vincent Ladeuil (vila) said :
#2

If you use a checkout you may want to experiment with:

   bzr revno

and

   bzr revno --tree

Revision history for this message
Anders Sneckenborg (anders-simbalsyd) said :
#3

Hi

I tried both but I get the revision for the complete repository. What I am
looking for is the revno I have reverted to?

Any ideas?

/Anders

2010/11/4 Marius Kruger <email address hidden>

> Your question #132321 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/132321
>
> Status: Open => Answered
>
> Marius Kruger proposed the following answer:
> I'd use `bzr revno` or `bzr log`
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/bzr/+question/132321/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/bzr/+question/132321
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Anders Sneckenborg (anders-simbalsyd) said :
#4

Hi

Same with these. I get the revno for the complete repository and not the
revision I have reverted to.

I hoped bzr info should contain the information but it is not.

/Anders

2010/11/4 Vincent Ladeuil <email address hidden>

> Your question #132321 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/132321
>
> Vincent Ladeuil proposed the following answer:
> If you use a checkout you may want to experiment with:
>
> bzr revno
>
> and
>
> bzr revno --tree
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/bzr/+question/132321/+confirm?answer_id=1
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/bzr/+question/132321
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Vincent Ladeuil (vila) said :
#5

What do you mean by 'revno for the complete repository' ?

A revno is a revision number and as such identifies a branch tip, an entry point in the ancestry graph.

A repository for bazaar is a store where revisions are stored and can be shared between branches if needed.

A branch is defined by a tip and a repository where, among others, the tip revision and all the revisions in its ancestry are stored.

A working tree is build from a revision by creating on disk all files described by the revision in a given state.

A working tree keeps track of the revisions it is based on to detect modifications, this reference tree is called the 'basis' tree.

'bzr revno' tells you the revision number of this basis tree.

After a 'bzr revert' the working tree has the same content as the basis tree, that's the contract of the 'revert' command.

So both Markus and I assumed that you were referring to the basis tree revno when you said 'active', if our assumption was wrong, please tell us what you call the 'active version'.

Revision history for this message
Anders Sneckenborg (anders-simbalsyd) said :
#6

Thanks for the informative description.

What I was looking for is a way to get the revno for the version after I have done revert according to below.

bzr revert 23 (23 is just an example)

... away for some time and now when I am back I wonder which version I did revert to

Is there such a command?

/Anders

Revision history for this message
Vincent Ladeuil (vila) said :
#7

bzr revno

Revision history for this message
nerpad (nerpad) said :
#8

I confirm Ander's problem. Revno doesn't change at all.

erpadmin@uberp03:~/ocode/client-web$ bzr revno
5

erpadmin@uberp03:~/ocode/client-web$ bzr update
Tree is up to date at revision 5 of branch /home/erpadmin/ocode/client-web

erpadmin@uberp03:~/ocode/client-web$ bzr revno
5

(ok, version 5, now I revert to version 2)

erpadmin@uberp03:~/ocode/client-web$ bzr revert -r 2
erpadmin@uberp03:~/ocode/client-web$

(ok, it seems it reverted adequately. I confirm that it deleted files and that left the folder accordingly to rev 2)

erpadmin@uberp03:~/ocode/client-web$ bzr revno
5

(It still shows rev 5. So I guess something is wrong. Below the details of my bazaar version)

erpadmin@uberp03:~/ocode/client-web$ bzr version
Bazaar (bzr) 2.1.1
  Python interpreter: /usr/bin/python 2.6.5
  Python standard library: /usr/lib/python2.6
  Platform: Linux-2.6.32-21-generic-i686-with-Ubuntu-10.04-lucid
  bzrlib: /usr/lib/python2.6/dist-packages/bzrlib
  Bazaar configuration: /home/erpadmin/.bazaar
  Bazaar log file: /home/erpadmin/.bzr.log

Copyright 2005-2010 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Bazaar is part of the GNU Project to produce a free operating system.

Revision history for this message
Vincent Ladeuil (vila) said :
#9

@mdelm: use 'bzr update -r<revno>' instead of 'bzr revert -r<revno>' and experiment with 'bzr revno' and 'bzr revno --tree'

Revision history for this message
John A Meinel (jameinel) said :
#10

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

On 03/29/2011 08:08 AM, Vincent Ladeuil wrote:
> Question #132321 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/132321
>
> Vincent Ladeuil proposed the following answer:
> @mdelm: use 'bzr update -r<revno>' instead of 'bzr revert -r<revno>' and
> experiment with 'bzr revno' and 'bzr revno --tree'
>

Revert reverts the contents of the file, but not the revision of the
tree. This is intentional. It is one way you can commit a rollback of
changes. (bzr revert -r -2 foo; bzr commit -m "I didn't mean that")

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

iEYEARECAAYFAk2Rhx4ACgkQJdeBCYSNAAMNuQCfVCPpysoUFznKOSHVW9Afrnk1
BioAnRf0GhGE+dAHPu5drWw35k+lBYsc
=rg3U
-----END PGP SIGNATURE-----

Revision history for this message
nerpad (nerpad) said :
#11

Yeap, that's fine. It works.

I applied then a sequence to move around versions when necessary:

bzr pull --> brings you to the last

and then
bzr update -r<version> --> goes back to where you want to
bzr clean-tree --> delete your changed files not to be commited (if any)
bzr revert -r<version> --> set modified/added files as original.

That permits you track the tree.
Pretty good ! Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Anders Sneckenborg for more information if necessary.

To post a message you must log in.