Comment 7 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

This script shows the observed problem. Key points:
* From an original directory move some files to a new directory
* Cause a RENAME change in the original source directory too (it must be a rename change)

The root cause is that mv --auto almost always sees the moving of a few files to a new directory as a rename of the directory - and that is only the case in a very limited number of circumstances:
* If the source directory is empty or gone (certainty)
* if the number of files moved to the new dir is bigger than the remaining number in the source one might say the directory moved (and some files were then moved back).

You can see this wrong behaviour also if you just move a few files from the original to the new without renaming stuff in the source dir: bzr will not die but it will mark the source as renamed to new, and it will have an "unknown" (= not added) status for the remaining source - which is very wrong also (the files that are still left in it were version controlled).

Execution of the above script:
jal@cluny:~/j$ ./tbzr
2.0dev
Created a standalone tree (format: 2a)
adding a
adding a/file1.java
adding a/file2.java
adding a/file3.java
adding a/file4.java
adding a/file5.java
Committing to: /home/jal/j/testrepo/
added a
added a/file1.java
added a/file2.java
added a/file3.java
added a/file4.java
added a/file5.java
Missing checkcommit.jar, not checking commits.
Committed revision 1.
removed:
  a/file1.java
  a/file2.java
  a/file3.java
modified:
  a/file4.java
unknown:
  c/
  a/file3new.java
  a/file4new.java
-------- moving ---------------
a => c
a/file1.java => c/file1new.java
a/file2.java => c/file2new.java
a/file3.java => a/file3new.java
bzr: ERROR: An inconsistent delta was supplied involving u'a', 'a-20090822092805-y0z3pmiccyt4ymgf-1'
reason: This parent is not present.
-------- status ---------------
removed:
  a/file1.java
  a/file2.java
  a/file3.java
modified:
  a/file4.java
unknown:
  c/
  a/file3new.java
  a/file4new.java