[PATCH 1 of 3 V2] convert: Add support to common commandline to access stdin of the process

Daniel Atallah daniel.atallah at gmail.com
Thu Mar 24 10:38:51 CDT 2011


On Thu, Mar 24, 2011 at 11:09, Mads Kiilerich <mads at kiilerich.com> wrote:
> On 03/24/2011 03:48 PM, daniel.atallah at gmail.com wrote:
>>
>> # HG changeset patch
>> # User Daniel Atallah<daniel.atallah at gmail.com>
>> # Date 1300906529 14400
>> # Branch stable
>> # Node ID 0fb617760b931cd25537e3362af52b2cfbd1a329
>> # Parent  913c2c66a555934cab9bcdac3412703256f9cdf2
>> convert: Add support to common commandline to access stdin of the process
>>
>> diff --git a/hgext/convert/common.py b/hgext/convert/common.py
>> --- a/hgext/convert/common.py
>> +++ b/hgext/convert/common.py
>> @@ -233,6 +233,7 @@
>>      def __init__(self, ui, command):
>>          self.ui = ui
>>          self.command = command
>> +        self.redirectstdin = True
>
> Is it really a good idea to have this as a state variable? Shouldn't it just
> be a parameter to _dorun and _cmdline?

I actually originally implemented it that way, but reverted to this
state variable for a couple reasons:

I didn't want to change the _cmdline() function signature (this itself
may not be important because it isn't used anywhere outside
common.py).

More importantly, _cmdline() is used by limit_arglist() (and
subsequently xargs(), which is used externally)

I can certainly make the changes and change the xargs() signature too
if that is desirable.

-D


More information about the Mercurial-devel mailing list