Gary van der Merwe пишет:
> * I have not read the whole thread yet.
>
> On Sun, Nov 29, 2009 at 2:37 PM, Alexander Belchenko <
bia...@ukr.net> wrote:
>> I'm very disappointed on our internal model to work with external diff and
>> merge tools. I've just filed the bug:
>>
>>
https://bugs.launchpad.net/qbzr/+bug/489915
>>
>> There is many similar bug reports about qconfig etc.
>> I'd like to change this bad situation.
>>
>> I have a important question though.
>> Does QBzr rely on extmerge, and if yes then how?
>
> The TreeWidget (qcommit/qbrowse) runs "bzr extmerge FILES" via the
> subprocess interface.
extmerge in fact is also run actual merge tool via subprocess (subprocess.call). So implementing the
inside qbzr won't be many work, but provides as better configuration capabilities.
Also I'm poking about ideas of automatic support of 3-way and 2-way merges as well. Because after
merge --weave (or --lca) there is no BASE file, so we'd like to run 2-way merge instead. Many merge
tools supports this mode too.
> qconflicts runs "bzr extmerge FILES" in some circumstances, and in
> others launches the merge app directly. I can't remember the details
> of where it does what.
>
> I would like to see these behave in the same way, and hopefully share
> code. qconflicts could maybe be made to use the TreeWidget.
That's approx what I have in mind when said that we should reconcile our internal model: we should
have one place to manage settings and use these settings to run merge tools.
> When I added the functionality to the TreeWidget, I use extmerge
> because I could reuse the subprocess work I did for extdiff. The
> important stuff here is the error reporting (which use to be flaky any
> way.) One of the ideas that I had at the time was that we could make
> qbzr work with extdiffs that output to stdout, and this would display
> in the subprocess dialog. No one has asked for the, so I guess it is
> not that important.
As I said I don't see reasons to not move the same approach into qbzr, and still continue using
subprocess. Just call the tool directly via subprocess (or maybe better QProcess)
>> In my opinion, if we need some functions from extmerge (or difftools to look
>> broader) we just need to merge these tools into our codebase and adapt them
>> to our needs. Rely on them as external plugins and provide 2 codepaths for
>> the case when they are installed or not is just waste oof our efforts. If we
>> need them, let's merge them in. If they will change in future, we pull
>> latest changes. Let's use them as upstream for us.
>> Like bzrlib uses ConfigObj library.
>
> difftools has 2 features that core bzr diff --using does not have,
> that are cool, and a lack of a feature that is uncool:
>
> * When diffing the working tree, it passes the working tree files to
> the extdiff. This allows you to edit these files in the extdiff. The
> bzr core bzr diff --using passes temp files, which you can't do any
> thing with. This is something that that I think should really be
> ported to the core bzr diff --using implementation
Agreed. Built-in diff --using has many limitations, which very unpleasant especially on Windows.
> * With difftools, if you don't specifiy any files, it passes the whole
> directory.
I've read the code of difftools and as I remember it has nice registry of knwon tools, so difftools
"knows" which tools supports diff of the trees. But this support has one serious flow IMO: there is
need some hacking to support renames. External diff tools knows nothing about rename of file in bzr,
so when you just dump revision tree to temp directory and run diff between revision tree and working
tree (as whole directories) you'll end up with situation: file foo deleted, file bar added when foo
renamed to bar.
This is hard problem. What you think about it?
In my opinion we at least can ask user, does she want to follow renames, and when dump revision
tree, we should rename files to match working tree.
> * difftools lacks --new and --old arguments. Which sucks.
Why for it's needed?
> So I think for diff, we could reuse the core api (not sub process) to
> create the temp files for non working tree files, be we should the
> launch the ext diff app our selfs.
As I wrote above we may want to adapt the code to create temp files to follow renames.
> For extmerge, I have no problem with doing this. This would allow us
> to also make it possible to setup multiple merge apps, that you could
> select through the ui. (like ext diff).
I'm not sure why you think we need support multiple choices for tools? Can you explain?
>> All plugins are licensed under GPL. So there is no problems to merge in my
>> understanding. Does merging other plugins to QBzr will be infringement of
>> open-source etiquette? Should we beg for approval from their authors? I hope
>> it's not.
>
> I don't think we need approval, it would be fine to just let them
> know. For extmerge, the code is very small, and I think that 90% of it
> will end up getting changed for our needs.
Yep.
> One thing that I would like our diff and extmerge to do, is to get the
> apps to open multiple files at once in the apps mdi/tabed interface.
> I'm not sure how to exactly how to do this. (This is why I like the
> tree behaviour of difftools, but I would prefer it to just open all of
> the changed files)
I think this is out of our control, so I don't see a reason to put efforts here.