[MERGE] Handle existing files cleanly in build_tree

Aaron Bentley aaron.bentley at utoronto.ca
Wed Aug 30 16:03:08 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> ...
> 
> 
> 
>>Me and Rob have tweaked the behavior: if a file 'foo' cannot be created
>>because of a bzrdir in the way, it gets created as 'foo.diverted'.
> 
> 
> Is it 'foo.diverted' or is it:
> 
> if bar/foo cannot be created because 'bar' is a versioned directory,
> then you create 'bar.diverted/' and you end up with 'bar.diverted/foo'.

In that case, I don't consider that foo/bar "cannot be created".  I
consider that bar can't be created.  So bar gets renamed as
bar.diverted.  And foo doesn't care that its parent directory has been
diverted.

So yes, you end up with "bar.diverted/foo", but foo itself doesn't
require special treatment.

> Looking at the test, I believe I see that you are creating a new file in
> the child tree, but if you aren't adding the file id to the child tree,
> then you lose the mapping back to the original file id.

I'm sorry, what do you mean here?  File ids are always added by
new_by_entry.

> I really think you want to divert the conflicting directory, and not the
> individual file.

The conflicting element may not be a directory.  That's what I test in
the 'target4' test: If I have "dir1/file/.bzr" and I try to create a
file (not *directory*) at "dir1/file", then the file is diverted.

On the other hand, the 'target3' test shows that if I have "dir1/.bzr",
and I try to create "dir1/file", I get "dir1.diverted/file"

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFE9ais0F+nu1YWqI0RAu99AJwKHOBvlZJ0ijIIJrViFvW8kj47TgCfRgD7
IARyhbsWaIkGcwZHzBOYqao=
=eAST
-----END PGP SIGNATURE-----




More information about the bazaar mailing list