[merge] Make merge internals private
Aaron Bentley
aaron.bentley at utoronto.ca
Wed Jan 18 02:18:47 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
| Why is only MergConflictHandler moved into _merge.py, and not the Merger
| class? Shouldn't something like 'merge_inner' be private?
I intended Merger and merge_inner to be public. MergeConflictHandler is
used by merge_core and changeset.
Tree Transform makes conflict resolution a lot simpler by providing a
list of conflicts you can loop through, instead of requiring a callback
to be supplied.
So while I can support most of the Merger api using Transform, callback
conflict handlers will not be supported.
| I know I feel the merge() interface is still sub-optimal. merge_inner()
| might be meant to be the internal interface, but it has different
| side-effects than merge().
That's intentional. merge_inner is just 'perform a text merge'. It
doesn't have any UI goop. But since people were not happy with either
merge() (UI) or merge_inner (API), I built them both on Merger, so
people can use Merger to pick and choose the functionality they want.
| I think that barring exceptional conditions, the only place that
| instantiates a Branch object should be at the UI level.
| (builtins.py/commands.py which should be moved into bzrlib/ui/ anyway :)
I can move merge.merge into commands.py, if that's really what people want.
| Also, there are some PEP8 violations in both merge.py and _merge.py,
| plus there is a comment about merge() which shouldn't be in _merge.py
| (it probably can just be deleted).
Yeah, my PEP8 foo isn't that hot now, and I think I hadn't read it at
the time I originally wrote this.
| Should 'get_tree' and 'get_revid_tree' be public?
No, I suppose not.
| The function 'file_exists()' doesn't seem to be used.
Okay, gone.
| I'm not sure about build_working_dir, either.
Well, it is just wrapper, so in one sense I agree. But it seems like an
obvious domain-level function to supply. build_working_dir(directory)
is a lot clearer to read than transform_tree(this_branch.working_tree(),
this_branch.basis_tree())
| Other than the above comments, the changes seem good.
Okay, I've pushed a revised version.
Aaron.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDzaWG0F+nu1YWqI0RAruaAJ407nYnyqX1FkvrKQhH+1Y1OSZDqgCfSm4x
kns1sFZy8MuONpYeCbGc+Io=
=YG25
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list