[bug] Storage broke 'bzr cat'

John Arbash Meinel john at arbash-meinel.com
Tue Jan 31 21:45:18 GMT 2006


Now with the storage changes in jam-integration, 'bzr cat -r 10' fails
when the file doesn't exist in an old revision.

This patch at least gets it to throw the correct exception.

We should probably add some tests that 'bzr cat -r' throws the right
exception. I'm not actually going to merge this, but I wanted it noticed.

Also, in my head 'bzr cat' should grab the id from the working tree.
Otherwise 'bzr cat' requires the full path of the file in the *old*
revision. If there have been renames, you may not know what that is. By
looking it up in the current tree, you could also do:

cd subdir
bzr cat -r 10 foo

And have it work for 'subdir/foo'.
https://launchpad.net/products/bzr/+bug/30190

John
=:->

=== modified file 'bzrlib/repository.py'
--- bzrlib/repository.py
+++ bzrlib/repository.py
@@ -252,17 +252,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))
-            try:
-                revno = self.revision_id_to_revno(revision_id)
-            except errors.NoSuchRevision:
-                # TODO: This should not be BzrError,
-                # but NoSuchFile doesn't fit either
-                raise BzrError('%r is not present in revision %s'
-                                % (file, revision_id))
-            else:
-                raise BzrError('%r is not present in revision %s'
-                                % (file, revno))
+            raise bzrlib.errors.BzrError('%r is not present in revision %s'
+                                        % (file, revision_id))
         tree.print_file(file_id)

     def get_transaction(self):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060131/0ca20c4a/attachment.pgp 


More information about the bazaar mailing list