This is actually a latent bug in the current 'diff' codebase.
The reason we didn't experience it until DirState is because the old 'get_file_mtime()' for older trees ignored the 'path' parameter, and only used the file-id.
What is happening is that the 'diff' code passes both a 'file_id' and a 'path' to find the modification time of a file.
And what is happening is that the current path for the file is not the same as the old path. But it doesn't show up as a 'rename' because the directory was renamed, not the file itself.
The fix is to not give the 'path' hint, when we can't be fully sure that it really is the path:
This is actually a latent bug in the current 'diff' codebase.
The reason we didn't experience it until DirState is because the old 'get_file_mtime()' for older trees ignored the 'path' parameter, and only used the file-id.
What is happening is that the 'diff' code passes both a 'file_id' and a 'path' to find the modification time of a file.
And what is happening is that the current path for the file is not the same as the old path. But it doesn't show up as a 'rename' because the directory was renamed, not the file itself.
The fix is to not give the 'path' hint, when we can't be fully sure that it really is the path:
=== modified file 'bzrlib/diff.py' change( meta_modified) 'utf8') , prop_str) header_ date(old_ tree, file_id, path)) header_ date(old_ tree, file_id, None))
_ patch_header_ date(new_ tree, file_id, path))
--- bzrlib/diff.py 2007-03-13 02:16:17 +0000
+++ bzrlib/diff.py 2007-04-11 21:27:57 +0000
@@ -472,7 +472,7 @@
prop_str = get_prop_
print >>to_file, '=== modified %s %r%s' % (kind, path.encode(
old_name = '%s%s\t%s' % (old_label, path,
- _patch_
+ _patch_
new_name = '%s%s\t%s' % (new_label, path,
I'll write some tests, and submit it to the mailing list.
In the mean time, the fix will be in the associated branch.