C-hglib - Level 0, API proposal.

Idan Kamara idankk86 at gmail.com
Tue Jul 9 07:56:31 CDT 2013


On Mon, Jul 8, 2013 at 10:27 PM, Iulian Stana <julian.stana at gmail.com>wrote:

>     >> b) hg log <- can produce huge output
>
>>  >> I know that some repo could have a huge log,
>> >> but I don't know if the user will use that huge output.
>> >> My single thought right now is to set a limit for the huge mass of
>> data.
>> >
>> > Err... No way.
>> >
>> > Please work harder on this. Discarding output from `hg log`
>> > is simply not acceptable. We can do (much) better.
>>
>
> Hmm, like I said, it was my first thought. I would like to get some
> suggest for this
> particular issue. Maybe some hits, where I can go and dig.
>
>
>
>> I think you should look at how python-hglib and JavaHg does this. They
>> both use a callback function that the programmer who uses the library
>> must supply. The callback function should answer the prompts.
>>
>>
> I believe the python-hglib tries to do something similar, but that it
>>
>> doesn't yet track the merge state in a dedicated object. The handlers in
>> python-hglib are here:
>>
>>   http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/merge.py
>>
>>
> From what I understand python-hglib, makes exactly what you said. There is
> a callback function that handle the prompts.
> The merge command gets an argument called cb (with can be a callback
> function).
> By default the cb argument is merge.handlers.abort[1] the defined
> function from
> merge.py file.
>
> > A merge prompt is "Dear user, I have found some conflicts while
>> > merging this two files. I would really appreciate your help in solving
>> > them."
>> > Replying "F*ck you" to such a gentle request from mercurial
>> > would be very unpolite. We are a bunch of nice guys.
>
>
> What I suggest here is exactly what python-hglib makes. There will be a
> possibly
> to set that callback function.
> I know that this thing can be a very rough, but a return code that will
> suggest that
> the merge failed can be enough.
>
>
It sounds fine as a first step, anything fancier is definitely not "level
0".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130709/a1569aab/attachment.html>


More information about the Mercurial-devel mailing list