[bug] can't cat revision after rename
Vincent LADEUIL
v.ladeuil at alplog.fr
Tue Feb 7 13:09:14 GMT 2006
Hi,
vila:~/tmp :) $ mkdir bug
vila:~/tmp :) $ cd bug
vila:~/tmp/bug :) $ bzr init
vila:~/tmp/bug :) $ echo tagada >toto
vila:~/tmp/bug :) $ bzr add toto
added toto
vila:~/tmp/bug :) $ bzr commit -m "toto created"
Committed revision 1.
vila:~/tmp/bug :) $ bzr rename toto foo
vila:~/tmp/bug :) $ bzr cat --revision 1 foo
bzr: ERROR: exceptions.NameError: global name 'BzrError' is not defined
at /home/vila/dune/src/bzr.dev/bzrlib/repository.py line 263
in print_file
vila:~/tmp/bug :( $ bzr cat --revision 1 toto
tagada
vila:~/tmp/bug :) $
Doing some research I found:
https://launchpad.net/products/bzr/+bug/3630
So I understand this is a known bug, but at least the error
message could be made clearer.
The following patch did the trick.
I was really enjoying renaming files with bzr (coming from CVS),
I'm a bit less enthusiastic now :-/
Thanks in advance to whoever will push this bug up in its TODO
stack :-)
Vincent
=== modified file 'bzrlib/repository.py'
--- bzrlib/repository.py
+++ bzrlib/repository.py
@@ -18,6 +18,7 @@
from bzrlib.decorators import needs_read_lock, needs_write_lock
from bzrlib.errors import InvalidRevisionId
+from bzrlib.errors import BzrError
from bzrlib.lockable_files import LockableFiles
from bzrlib.osutils import safe_unicode
from bzrlib.revision import NULL_REVISION
@@ -260,7 +261,8 @@
# use inventory as it was in that revision
file_id = tree.inventory.path2id(file)
if not file_id:
- raise BzrError("%r is not present in revision %s" % (file, revno))
+ raise BzrError("%r is not present in revision %s" %
+ (file, revision_id))
try:
revno = self.revision_id_to_revno(revision_id)
except errors.NoSuchRevision:
More information about the bazaar
mailing list