bzr: ERROR: The file id "foo-20080731224042-7ogu3b3hk0bwnpo3-1" is not present in the tree

Bug #253806 reported by LaMont Jones
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Vincent Ladeuil

Bug Description

If a file is added, removed, and re-added, the "bzr cat -r$original_add foo" spits out something on the order of:

bzr: ERROR: The file id "foo-20080731224042-7ogu3b3hk0bwnpo3-1" is not present in the tree <Inventory object at 8881aac, contents={'foo-20080731224035-dntx8rh11924l38j-1': InventoryFile('foo-20080731224035-dntx8rh11924l38j-1', 'foo', parent_id='TREE_ROOT', sha1='4e1243bd22c66e76c2ba9eddc1f91394e57f9f83', len=5), 'TREE_ROOT': InventoryDirectory('TREE_ROOT', u'', parent_id=None, <email address hidden>')}>.

lamont

Related branches

Revision history for this message
LaMont Jones (lamont) wrote :
Revision history for this message
LaMont Jones (lamont) wrote :

Bug is present in 1.3.1-1, as well as 1.6~beta3-1

Revision history for this message
James Westby (james-w) wrote :

Hi,

Thanks for the bug.

I can see this
        cur_file_id = tree.path2id(relpath)
        rev_tree = b.repository.revision_tree(revision_id)
        old_file_id = rev_tree.path2id(relpath)

        if name_from_revision:
            if old_file_id is None:
                raise errors.BzrCommandError("%r is not present in revision %s"
                                                % (filename, revision_id))
            else:
                content = rev_tree.get_file_text(old_file_id)
        elif cur_file_id is not None:
            content = rev_tree.get_file_text(cur_file_id)
        elif old_file_id is not None:
            content = rev_tree.get_file_text(old_file_id)

so it assumes that a file id in a newer revision will be present in an older one.

I haven't thought it through, but it probably wants to either try old_file_id first,
or catch the error in the new_file_id use.

I think the former, othewise there may be no way to access certain paths in
the old revision.

This sort of thing occurs in a few places, maybe we need to look
at a way to specify whether you are talking about a current path,
an old one, or a specific path over time, regarless of file ids (for log).

Thanks,

James

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

Actually, in this particular case, I would guess that LaMont would rather just have the file restored with its old file-id.

I don't know his specific use case, but I think he was using "bzr add" as a substitute for 'bzr revert'.

Revision history for this message
Anthony Bush (awbush) wrote :

I run into this same error when using bzr shelve/unshelve, causing shelved changes to remain shelved (see attachment).

Output from bzr --version:

Bazaar (bzr) 1.11
  Python interpreter: /System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python 2.5.1
  Python standard library: /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
  bzrlib: /Library/Python/2.5/site-packages/bzrlib

Revision history for this message
Vincent Ladeuil (vila) wrote :

That's a bug, we try to find the file content under the file id used in the current working tree and fail to fallback to the old file id if it can't be found in the requested revision.

Changed in bzr:
assignee: nobody → vila
milestone: none → 1.13
status: Confirmed → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
status: Fix Committed → 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.