[merge] Make merge internals private
Aaron Bentley
aaron.bentley at utoronto.ca
Wed Jan 18 14:24:13 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> In the version I have
> <aaron.bentley at utoronto.ca-20060118015458-ba73c07352e1af17>
> only MergeConflictHandler is in _merge.py.
Oh, heh. I started by moving *everything* to _merge.py, and then moving
back the things that I thought should be public.
> Perhaps if this is meant to
> be a bzrlib-internal class it would be better called
> _MergeConflictHandler. (In which case it could go back in merge.py if
> you wanted :-)
Oh, I thought we could make entire files private by prefixing them with
an underscore. _merge._MergeConflictHandler seems like overkill, but I
can put it back in merge, instead.
> I shared John's surprise that it would become private, thinking that
> this would mean it wasn't possible to customize conflict handling. So
> perhaps a comment explaining the right (or new) way to do it would help.
I'm not sure that, for a given operation, it's useful to customize
conflict handling. To date, real code only uses MergeConflictHandler,
and testing code uses ExceptionConflictHandler. So I think this is an
API in search of a problem.
Reverting a tree and performing a merge have different conflict handling
needs, but there's no reason I can see to vary the conflict handling of
merge, per se. So each operation does its own conflict handling.
transform.build_tree does no conflict resolution at all. If you get a
conflict building a tree in an empty directory, Something Is Wrong,
probably with your source data. This is not dangerous, because
TreeTransform.apply will not run unless there are no conflicts.
transform.revert resolves filesystem conflicts using
transform.resolve_conflicts, but cannot get merge conflicts.
transform.ApplyMerge3 handles merge conflicts itself, and resolves
filesystem conflicts with transform.resolve_conflicts.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDzk+N0F+nu1YWqI0RAoPnAJ40pZ2JMnsc/lnc2oF2NkSXMqCbPgCaArCX
S9+hFNOSCG52qmrZDbBiq5M=
=1SR9
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list