bzr revert '.' can fail when there are added, missing, directories.

Bug #367632 reported by Robert Collins
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Robert Collins

Bug Description

The root cause is in dirstate's iter_changes. The following test will exercise it:
=== modified file 'bzrlib/tests/per_intertree/test_compare.py'
--- bzrlib/tests/per_intertree/test_compare.py 2009-07-14 10:12:30 +0000
+++ bzrlib/tests/per_intertree/test_compare.py 2009-07-16 05:31:32 +0000
@@ -757,6 +757,26 @@
             (None, root_id), (None, 'file'), (None, None), (None, False))]
         self.assertEqual(expected, self.do_iter_changes(tree1, tree2))

+ def test_only_in_target_missing_subtree_specific_bug_367632(self):
+ tree1 = self.make_branch_and_tree('tree1')
+ tree2 = self.make_to_branch_and_tree('tree2')
+ tree2.set_root_id(tree1.get_root_id())
+ self.build_tree(['tree2/dir/', 'tree2/dir/file'])
+ tree2.add(['dir', 'dir/file'], ['dir-id', 'file-id'])
+ os.unlink('tree2/dir/file')
+ os.rmdir('tree2/dir')
+ tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
+ self.not_applicable_if_missing_in('dir', tree2)
+ root_id = tree1.path2id('')
+ expected = [
+ ('dir-id', (None, 'dir'), False, (False, True),
+ (None, root_id), (None, 'directory'), (None, None), (None, False)),
+ ('file-id', (None, 'dir/file'), False, (False, True),
+ (None, root_id), (None, 'dir-id'), (None, None), (None, False))
+ ]
+ self.assertEqual(expected,
+ self.do_iter_changes(tree1, tree2, specific_files=['']))
+
     def test_unchanged_with_renames_and_modifications(self):
         """want_unchanged should generate a list of unchanged entries."""
         tree1 = self.make_branch_and_tree('1')

 The corruption is a missing changes-aborted flag on dirstate, I'll roll that into my apply_inventory_delta branch.

Tags: dirstate
Jelmer Vernooij (jelmer)
Changed in bzr:
status: New → Triaged
Revision history for this message
Robert Collins (lifeless) wrote :

The '.' in the revert is required to trigger this dirstate corruption. I'm whittling down a smaller case.

description: updated
summary: - bzr revert after complex operations fails
+ bzr revert '.' can fail
description: updated
summary: - bzr revert '.' can fail
+ bzr revert '.' can fail when there are added, missing, directories.
description: updated
description: updated
description: updated
Revision history for this message
Robert Collins (lifeless) wrote :

Bumped to high - this is a infrastructure problem that is likely manifesting in other commands dealing with specific files and new-but-missing items - e.g. commit is probably failing in this situation too. Its also rather easy to construct when fiddling around with a new tree.

Changed in bzr:
importance: Medium → High
Revision history for this message
Robert Collins (lifeless) wrote :

My apply-inventory-delta branch fixes the corruption that was occuring, leaving just the bug of revert failiing due to the incomplete iter_changes output.

tags: added: dirstate
Changed in bzr:
assignee: nobody → Robert Collins (lifeless)
status: Triaged → Fix Committed
Changed in bzr:
milestone: none → 1.18
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.