computing the resulting inventory from the merge changeset

Aaron Bentley aaron.bentley at utoronto.ca
Mon Dec 19 14:22:17 GMT 2005


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

duchier at ps.uni-sb.de wrote:
> I think now stupid me finally understands what you were trying to tell
> me.  Here is a 2-phase algorithm that, in retrospect, is pretty
> obvious:

Yes, the outline of this looks right to me.


>     for e in source_entries:
>         if e.parent is not None \
>            and e.new_parent is not None \
>            and e.needs_rename():

A nitpick is that inventory entries and files may require different
operations; the inventory entry may need to be renamed, while the file
contents need to be created.  This can't happen in committed revisions,
but it can happen in working directories.

So needs_rename will refer to the file contents, but we could add
Changeset.ie_needs_rename() or something.

>             assert ie.kind<>"directory" or not ie.children

I don't think we have a style rule about it, but we use != everywhere
else in the code.  <> isn't intuitive to me, because some things that
are different have no obvious ordering.  I didn't even know Python
supported that form.

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

iD8DBQFDpsIZ0F+nu1YWqI0RAhqTAJ4vyXbmO3lzHWQm4QShc6Gedip5dwCfYBSQ
V2YNeKBnxcemap0Elvpztxs=
=B6BS
-----END PGP SIGNATURE-----




More information about the bazaar mailing list