Comment 5 for bug 373319

Revision history for this message
Frits Jalvingh (fjalvingh) wrote : Re: dirstate AssertionError: "Could not find target parent in wt" after auto mv/rename or deleting directory

Oops... I missed your request, sorry.

I am able to reproduce in our full tree, I will try to make a script for you.

The base cause seems very clear though in the topmost trace, the bzr mv --auto **renames**:

vp-soap-server/test/nl/itris/soap/server => vp-soap-server/test/nl/itris/soap/util

but the source dir (vp-soap-server/test/nl/itris/soap/server) contains files and they are actually touched afterwards - this cannot be the case after the move..

I made a new testcase and tried it with bzr-1.17:
jal@odeon:~/bzr/xxx$ bzr status
removed:
  vp-soap-server/test/nl/itris/soap/server/DummySoapCallClass1.java
  vp-soap-server/test/nl/itris/soap/server/JaxbInputObject.java
  vp-soap-server/test/nl/itris/soap/server/TestAnnotatedCall.java
  vp-soap-server/test/nl/itris/soap/server/TestFormatDecoders.java
  vp-soap-server/test/nl/itris/soap/server/TestJaxb.java
  vp-soap-server/test/nl/itris/soap/server/TestMimeDecoders.java
  vp-soap-server/test/nl/itris/soap/server/TestXmlExecutor.java
unknown:
  vp-soap-server/test/nl/itris/soap/newone/
  vp-soap-server/test/nl/itris/soap/server/FormatDecodersTest.java
  vp-soap-server/test/nl/itris/soap/server/JaxbTest.java
  vp-soap-server/test/nl/itris/soap/server/SoapDummyCallClass1.java
  vp-soap-server/test/nl/itris/soap/server/XmlExecutorTest.java
jal@odeon:~/bzr/xxx$ tar czf ~/testbzr-xxx .
jal@odeon:~/bzr/xxx$ bzr mv --auto
vp-soap-server/test/nl/itris/soap/server => vp-soap-server/test/nl/itris/soap/newone
vp-soap-server/test/nl/itris/soap/server/DummySoapCallClass1.java => vp-soap-server/test/nl/itris/soap/server/SoapDummyCallClass1.java
vp-soap-server/test/nl/itris/soap/server/TestFormatDecoders.java => vp-soap-server/test/nl/itris/soap/server/FormatDecodersTest.java
vp-soap-server/test/nl/itris/soap/server/TestJaxb.java => vp-soap-server/test/nl/itris/soap/server/JaxbTest.java
vp-soap-server/test/nl/itris/soap/server/TestXmlExecutor.java => vp-soap-server/test/nl/itris/soap/server/XmlExecutorTest.java
jal@odeon:~/bzr/xxx$ bzr status
bzr: ERROR: exceptions.AssertionError: Could not find target parent in wt: vp-soap-server/test/nl/itris/soap/server
parent of: (('vp-soap-server/test/nl/itris/soap/server', 'FormatDecodersTest.java', 'testformatdecoders.j-20090811164112-c8rqxirf7yq88zvh-1190'), [('f', '', 0L, 0, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'), ('r', 'vp-soap-server/test/nl/itris/soap/server/TestFormatDecoders.java', 0L, 0, '')])

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1045, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 310, in run
    show_pending=(not no_pending), verbose=verbose)
  File "/usr/lib/python2.6/dist-packages/bzrlib/status.py", line 118, in show_tree_status
    want_unversioned=want_unversioned)
  File "/usr/lib/python2.6/dist-packages/bzrlib/tree.py", line 95, in changes_from
    want_unversioned=want_unversioned,
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/tree.py", line 891, in compare
    want_unversioned=want_unversioned)
  File "/usr/lib/python2.6/dist-packages/bzrlib/delta.py", line 230, in _compare_trees
    want_unversioned=want_unversioned):
  File "_dirstate_helpers_pyx.pyx", line 1350, in bzrlib._dirstate_helpers_pyx.ProcessEntryC.__next__
  File "_dirstate_helpers_pyx.pyx", line 1609, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next
  File "_dirstate_helpers_pyx.pyx", line 1211, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._process_entry
AssertionError: Could not find target parent in wt: vp-soap-server/test/nl/itris/soap/server
parent of: (('vp-soap-server/test/nl/itris/soap/server', 'FormatDecodersTest.java', 'testformatdecoders.j-20090811164112-c8rqxirf7yq88zvh-1190'), [('f', '', 0L, 0, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'), ('r', 'vp-soap-server/test/nl/itris/soap/server/TestFormatDecoders.java', 0L, 0, '')])

bzr 1.17 on python 2.6.2 (linux2)
arguments: ['/usr/bin/bzr', 'status']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [1.17]
  commitchecker /home/jal/.bazaar/plugins/commitchecker.py [unknown]
  fastimport /home/jal/.bazaar/plugins/fastimport [0.9dev]
  launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [1.17]
  netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [1.17]
  qbzr /home/jal/.bazaar/plugins/qbzr [0.14dev]
  rebase /home/jal/.bazaar/plugins/rebase [0.5.4dev]
  repodetails /home/jal/.bazaar/plugins/repodetails [1.9dev]
  xmloutput /usr/lib/python2.6/dist-packages/bzrlib/plugins/xmloutput [0.8.3]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

This has the same behaviour: moving the source directory while files are present in it. I then did the same with bzr.dev:
jal@odeon:~/bzr$ rm -rf xxx/
jal@odeon:~/bzr$ mkdir xxx
jal@odeon:~/bzr$ cd xxx/
jal@odeon:~/bzr/xxx$ tar xzf ~/testbzr-xxx
jal@odeon:~/bzr/xxx$ bzr status
removed:
  vp-soap-server/test/nl/itris/soap/server/DummySoapCallClass1.java
  vp-soap-server/test/nl/itris/soap/server/JaxbInputObject.java
  vp-soap-server/test/nl/itris/soap/server/TestAnnotatedCall.java
  vp-soap-server/test/nl/itris/soap/server/TestFormatDecoders.java
  vp-soap-server/test/nl/itris/soap/server/TestJaxb.java
  vp-soap-server/test/nl/itris/soap/server/TestMimeDecoders.java
  vp-soap-server/test/nl/itris/soap/server/TestXmlExecutor.java
unknown:
  vp-soap-server/test/nl/itris/soap/newone/
  vp-soap-server/test/nl/itris/soap/server/FormatDecodersTest.java
  vp-soap-server/test/nl/itris/soap/server/JaxbTest.java
  vp-soap-server/test/nl/itris/soap/server/SoapDummyCallClass1.java
  vp-soap-server/test/nl/itris/soap/server/XmlExecutorTest.java
jal@odeon:~/bzr/xxx$ ~/bzr.dev/bzr version
Bazaar (bzr) 2.0dev
  from bzr checkout /home/jal/bzr.dev
    revision: 4636
    revid: <email address hidden>
    branch nick: bzr.dev
  Python interpreter: /usr/bin/python 2.6.2
  Python standard library: /usr/lib/python2.6
  Platform: Linux-2.6.28-15-generic-x86_64-with-Ubuntu-9.04-jaunty
  bzrlib: /home/jal/bzr.dev/bzrlib
  Bazaar configuration: /home/jal/.bazaar
  Bazaar log file: /home/jal/.bzr.log

Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

jal@odeon:~/bzr/xxx$ ~/bzr.dev/bzr status
removed:
  vp-soap-server/test/nl/itris/soap/server/DummySoapCallClass1.java
  vp-soap-server/test/nl/itris/soap/server/JaxbInputObject.java
  vp-soap-server/test/nl/itris/soap/server/TestAnnotatedCall.java
  vp-soap-server/test/nl/itris/soap/server/TestFormatDecoders.java
  vp-soap-server/test/nl/itris/soap/server/TestJaxb.java
  vp-soap-server/test/nl/itris/soap/server/TestMimeDecoders.java
  vp-soap-server/test/nl/itris/soap/server/TestXmlExecutor.java
unknown:
  vp-soap-server/test/nl/itris/soap/newone/
  vp-soap-server/test/nl/itris/soap/server/FormatDecodersTest.java
  vp-soap-server/test/nl/itris/soap/server/JaxbTest.java
  vp-soap-server/test/nl/itris/soap/server/SoapDummyCallClass1.java
  vp-soap-server/test/nl/itris/soap/server/XmlExecutorTest.java
jal@odeon:~/bzr/xxx$ ~/bzr.dev/bzr mv --auto
vp-soap-server/test/nl/itris/soap/server => vp-soap-server/test/nl/itris/soap/newone
vp-soap-server/test/nl/itris/soap/server/DummySoapCallClass1.java => vp-soap-server/test/nl/itris/soap/server/SoapDummyCallClass1.java
vp-soap-server/test/nl/itris/soap/server/TestFormatDecoders.java => vp-soap-server/test/nl/itris/soap/server/FormatDecodersTest.java
vp-soap-server/test/nl/itris/soap/server/TestJaxb.java => vp-soap-server/test/nl/itris/soap/server/JaxbTest.java
vp-soap-server/test/nl/itris/soap/server/TestXmlExecutor.java => vp-soap-server/test/nl/itris/soap/server/XmlExecutorTest.java
bzr: ERROR: An inconsistent delta was supplied involving u'vp-soap-server/test/nl/itris/soap/server', 'server-20090811164112-c8rqxirf7yq88zvh-706'
reason: This parent is not present.

Different error, same problem.

I will try to make a script for this but need to find some time to do so.