JavaHg and merge prompts

Martin Geisler mg at aragost.com
Mon Jan 16 08:35:20 CST 2012


Idan Kamara <idankk86 at gmail.com> writes:

> On Thu, Jan 12, 2012 at 12:46 PM, Martin Geisler <mg at aragost.com> wrote:
>
>> Hi everybody,
>>
>> Jan is working on JavaHg and brought up an interesting question with
>> regard to the command server and merge manifest prompts: how should
>> they be handled in command server libraries?
>>
>> Currently, JavaHg operates with the a notion of a
>> ManifestMergeOracle, which is an "oracle" that can answer the queries
>> made by the manifest merge prompts:
>>
>> https://bitbucket.org/aragost/javahg/src/ea0546d3d495/src/test/java/com/aragost/javahg/commands/MergeCommandTest.java#cl-60
>>
>> The idea is that the programmer examines the situation up-front and
>> adds answers to the oracle before calling merge. He can also run the
>> merge with no answers and the oracle will then record the file names
>> for which prompts were given. The programmer can then re-run the
>> merge after cleaning up.
>>
>> Have you guys got any input on this? Will python-hglib handle this in
>> a smarter or easier way?
>
> python-hglib doesn't do anything fancy: it lets you pass a callback
> that receives all output generated by the command so far, which should
> return one of the valid answers.

Okay, thanks for the answer.

> There are also two "merge handlers", the first simply aborts if
> there's a prompt. The second is equivalent to the non-interactive
> option (-y).
>
> We could add more handlers in the future to do something similar to
> JavaHg, like passing a dictionary of paths with answers, or a "pick
> modified/deleted". Not sure how useful those are though.

Well, we'll see when JavaHg gets integrated with MercurialEclipse. That
will be the real test for our API and we're looking forward to their
feedback.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list