Response file as an alternative to command line passing of arguments/commands/options?

Lasse Vågsæther Karlsen lasse at vkarlsen.no
Thu Dec 23 04:16:02 CST 2010


The reason I'm asking the following question is that I'm writing a .NET
class library that wraps around the Mercurial command line client, and
".NET-ifies" the interface, eventually building a command line and executing
it, capturing and parsing the output from the client back into .NET.

Then I found this question on Stack Overflow:
http://stackoverflow.com/questions/4512321/resulting-command-line-for-hg-exe-too-long-error-in-mercurial,
indicating that a program generated a too long command line for Mercurial,
the shell, or whatever, to process.

<http://stackoverflow.com/questions/4512321/resulting-command-line-for-hg-exe-too-long-error-in-mercurial>Then
it dawned on me that the problem described in that question might be a
problem for my library as well, although I don't know how big that would be.
I will test to get the exact limits.

However, at this point I thought that perhaps the Mercurial command client
has a way for me to put all the arguments to it into a text file, and just
ask it to read from that in addition to whatever is on the command line,
however digging into the help file doesn't seem to give me any way to do
that.

Asking on irc (#Mercurial @ freenode) seems to indicate that this issue has
been asked on the mailing list before, and discard, so I have a couple of
questions:

1. Is there such a way?
2. If not, wouldn't it be a good idea, seeing as the command line
is advertised as the stable public API (ref:
http://mercurial.selenic.com/wiki/MercurialApi), if you read the question
linked to above, the way to get around it was to commit in batches, surely
that can't be the right way to do it?
3. What alternatives do I have? Pull up my sleeves and submit a patch?
(though that would be aways before coming seeing as though I know Python, I
am not an expert and I don't know the Mercurial code)

In lieu of question #3, I was thinking that perhaps my class library could
write out Python files instead, calling directly into the Mercurial code,
but this would mean that I would require both Python installed and more than
the pure binary (I'm guessing at this) to be able to actually call into the
code from a python program.

I also asked my own question about this on Stack Overflow, but going by the
answers on irc, I don't think there is a way to do this:
http://stackoverflow.com/questions/4517628/mercurial-command-line-client-reading-commands-options-and-arguments-from-a-fi
<http://stackoverflow.com/questions/4517628/mercurial-command-line-client-reading-commands-options-and-arguments-from-a-fi>
-- 
Lasse Vågsæther Karlsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20101223/64f44dc7/attachment.htm>


More information about the Mercurial-devel mailing list