Comment 10 for bug 395556

Revision history for this message
Martitza (martitzam) wrote : Re: bzr mv (rename in place) causes commit to fail depending on specific filenames

I have been able to spend only a few minutes on the code and spending most of that time learning a bit of the API. But maybe these notes will save an expert time in narrowing down how the changes between 1.13 and 1.14 may have caused the issue we are seeing.

I am currently focused on function apply_delta in inventory.py.

Where bzr 1.13 has

                new_entry.children = children.pop(new_entry.file_id, {})

bzr 1.14 has

                replacement = InventoryDirectory(new_entry.file_id,
                    new_entry.name, new_entry.parent_id)
                replacement.revision = new_entry.revision
                replacement.children = children.pop(replacement.file_id, {})
                new_entry = replacement

So the children are the same, naturally, but other new_entry members are being manipulated which were not before.

We get there in bzr 1.14 via finish_inventory ==> add_inventory_by_delta
whereas in bzr 1.13 we have finish_inventory ==> add_inventory

Here is the traceback from 1.14:

[ 2868] 2009-07-09 17:27:42.494 INFO: aborting commit write group: DuplicateFileId(File id {2-20090710002726-8f8ab83hol6cpulq-1} already exists in inventory as InventoryFile('2-20090710002726-8f8ab83hol6cpulq-1', '1', parent_id='TREE_ROOT', sha1='7e4a53de1f83762dd2febd39b818e2258bc83bc1', len=13, revision=martitza@rubuntu-20090710002735-37qmq4uutgy5l44s))
0.360 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 727, in exception_to_return_code
  File "bzrlib\commands.pyo", line 922, in run_bzr
  File "bzrlib\commands.pyo", line 559, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 2878, in run
  File "bzrlib\decorators.pyo", line 192, in write_locked
  File "bzrlib\workingtree_4.pyo", line 226, in commit
  File "bzrlib\decorators.pyo", line 192, in write_locked
  File "bzrlib\mutabletree.pyo", line 228, in commit
  File "bzrlib\commit.pyo", line 371, in commit
  File "bzrlib\repository.pyo", line 212, in finish_inventory
  File "bzrlib\repository.pyo", line 1059, in add_inventory_by_delta
  File "bzrlib\inventory.pyo", line 1160, in apply_delta
  File "bzrlib\inventory.pyo", line 1250, in add
DuplicateFileId: File id {2-20090710002726-8f8ab83hol6cpulq-1} already exists in inventory as InventoryFile('2-20090710002726-8f8ab83hol6cpulq-1', '1', parent_id='TREE_ROOT', sha1='7e4a53de1f83762dd2febd39b818e2258bc83bc1', len=13, revision=martitza@rubuntu-20090710002735-37qmq4uutgy5l44s)

0.360 return code 3