unshelving two or more file creations fails

Bug #363444 reported by Stavros Korokithakis
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
James Westby

Bug Description

bzr unshelve crashes sometimes when there file adds and reverts. The error is this:

Unshelving changes with id "1".
bzr: ERROR: The file id "test3-20090418175641-21x7z9klix380a5l-1" is not present in the tree <Inventory object at 1318690, contents="{'testfile-20090418175511-1k3ymsucwiimo24l-1': InventoryFile('testfile-20090418175511-1k3ymsucwiimo24l-1', 'testfile', parent_id='TREE_ROOT', sha1='9cf0866149ac54c7eb4c727e921a7be600ec0c5d', len=41, <email address hidden>), 'TREE_ROOT': InventoryDirectory('TREE_ROOT', u'', parent_id=None, <email address hidden>')}">.

Related branches

Revision history for this message
Stavros Korokithakis (stavrosk) wrote :
Revision history for this message
Stavros Korokithakis (stavrosk) wrote :

cat test > testfile
bzr add
adding testfile
bzr ci -m "Commit."
Committing to: /private/tmp/lala/
added testfile
Committed revision 1.
touch test2
touch test3
bzr add
adding test2
adding test3
bzr shelve --all
Selected changes:
-D test2
-D test3
Changes shelved with id "1".
touch minor
bzr revert
bzr unshelve
Unshelving changes with id "1".
bzr: ERROR: The file id "test3-20090418181504-01lruxrlotf2muvx-2" is not present in the tree <DirStateRevisionTree of <email address hidden> in DirState(u'/private/tmp/lala/.bzr/checkout/dirstate')>.

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

#!/bin/bash
set -e
rm -rf test
bzr init test
(cd test && bzr ci -m "Commit." --unchanged && touch test2 test3 && bzr add && bzr shelve --all && bzr -Derror unshelve)

That's a minimal test case, i.e. simply adding shelving two adds and unshelving shows
the crash.

The issue is that while the serialized transform contains records for both added files, only
the first is yielded by the "records" that is passed to deserialize() (and it's only one
if you do it with three files as well). Could it be a bug in the bencode that makes it
think the end of the file has arrived after the first added file record?

Thanks,

James

James Westby (james-w)
summary: - unshelve crashes if there is a revert and file shelve.
+ unshelving two or more file creations fails
Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
James Westby (james-w) wrote :

Hi,

Here's a fix.

It's not a merge request, as while the test_pack test shows the fix
working, the test_shelf one still fails, and I can't work out why.

Thanks,

James

Changed in bzr:
assignee: nobody → James Westby (james-w)
status: Confirmed → In Progress
Aaron Bentley (abentley)
Changed in bzr:
milestone: none → 1.17
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.