0

When I type bzr revno in the project directory, it displays for me the latest version I've received from my last bzr update rather than what I've reverted to most recently. Obviously bzr is more worried about what I've checked out, rather than the code revision I'm working with.

This is also the case if I do bzr update -rN.

For example:

patrick@blendtec:~/Project$ bzr update                                                                                                            
Tree is up to date at revision 743 of branch bzr+ssh://patrick@ninja/Project                                                                  
patrick@blendtec:~/Project$ bzr revert -r 720
 M  makefile
 M  file.cpp
 M  file.h
-D  other_file.h
patrick@blendtec:~/Project$ bzr revno                                                                                                             
743
patrick@blendtec:~/Project$ bzr revno --tree
743

So... what command does one use to display the revision number of the code that's been reverted to?

pdm
  • 1,027
  • 1
  • 9
  • 24

1 Answers1

0

You can use

bzr revno --tree

to get the revision number of the current working tree. Alternatively, you can also use bzr version-info with an appropriate template, e.g.:

bzr version-info --custom --template='{revno}\n'
Reimer Behrends
  • 8,600
  • 15
  • 19
  • Thanks for the reply, but both of those give me the version I've got checked out, not the version I've reverted to. – pdm May 27 '16 at 16:51
  • I've amended my post to illustrate the issue more clearly. – pdm May 27 '16 at 16:59
  • 1
    I think you may be misunderstanding the purpose of `bzr revert`. Reverting to a revision will change the state of the working tree (either all or some of the files), but not the version of the working tree itself, which remains unchanged. Consider that you can revert some files from one version and the remaining files from another version; the working tree will correspond to neither of them. – Reimer Behrends May 27 '16 at 18:12
  • 1
    That is a fine point, and I appreciate the insight. I suppose then I'd want to use something like the revision number of a specific file, but it doesn't look like `bzr revno` supports that granularity. Is there a solution that you're aware of to this problem? – pdm Jun 02 '16 at 15:46
  • Unfortunately, this information is not something that Bazaar – or any other version control system I can think of – tracks. It's simply not something that they are designed for, as modern VCSs (post CVS) tend to think in terms of atomic modifications of the entire working tree, not parts of it. – Reimer Behrends Jun 03 '16 at 23:20