Comment 5 for bug 377261

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :

I'm getting this when resolving conflicts.

In the case where a merged revision has added a file with the same name and moved the original out of the way. If you manually delete the new file and revert the old one back into place, then you get this error. The workaround is to revert the NEW file, which puts things back AND resolves the conflict.

# wrong way
rm V3TemplateXMLHandler.java # the new one
bzr revert V3TemplateXMLHandler.java.moved
bzr resolved V3TemplateXMLHandler.java

bzr inventory

bzr: ERROR: exceptions.AssertionError: name u'V3TemplateXMLHandler.java' already in parent

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1127, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 783, in run
    entries = tree.inventory.entries()
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 401, in _get_inventory
    self._generate_inventory()
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 337, in _generate_inventory
    % (name_unicode,))
AssertionError: name u'V3TemplateXMLHandler.java' already in parent

bzr 2.2.1 on python 2.6.6 (Linux-2.6.35-25-generic-x86_64-with-Ubuntu-10.10-maverick)
arguments: ['/usr/bin/bzr', 'inventory']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.utf8'
plugins:
  bash_completion /usr/lib/python2.6/dist-packages/bzrlib/plugins/bash_completion [2.2.1]
  bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [2.2.0]
  launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [2.2.1]
  netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [2.2.1]
  news_merge /usr/lib/python2.6/dist-packages/bzrlib/plugins/news_merge [2.2.1]
  qbzr /usr/lib/python2.6/dist-packages/bzrlib/plugins/qbzr [0.19.1]
  rewrite /usr/lib/python2.6/dist-packages/bzrlib/plugins/rewrite [0.6.1]
  svn /usr/lib/python2.6/dist-packages/bzrlib/plugins/svn [1.0.3]
  xmloutput /home/adrian/.bazaar/plugins/xmloutput [0.8.7.dev]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

# right way
bzr revert V3TemplateXMLHandler.java

# this removes the new file and reverts the moved one back into position