[PATCH 1 of 5 VERSION2] subrepo: support for adding a git subrepo

Augie Fackler durin42 at gmail.com
Sun Nov 14 20:58:43 CST 2010


On Nov 14, 2010, at 8:53 PM, Eric Eisner wrote:

> On Sun, Nov 14, 2010 at 20:40, Augie Fackler <durin42 at gmail.com> wrote:
> 
>> 
>> On Nov 14, 2010, at 5:44 PM, Eric Eisner wrote:
>>> +    def _gitnodir(self, commands):
>>> +        """Calls the git command
>>> +
>>> +        The methods tries to call the git command. versions previor to
>> 1.6.0
>>> +        are not supported and very probably fail.
>>> +        """
>>> +        cmd = ['git'] + commands
>>> +        cmd = [util.shellquote(arg) for arg in cmd]
>>> +        cmd = util.quotecommand(' '.join(cmd))
>>> +
>>> +        # print git's stderr, which is mostly progress and useful info
>>> +        p = subprocess.Popen(cmd, shell=True, bufsize=-1,
>>> +                             close_fds=(os.name == 'posix'),
>>> +                             stdout=subprocess.PIPE)
>> 
>> util.popen3? I'm guessing there's a reason you chose subprocess, but I'm
>> curious what the rationale is.
> 
> 
> The various util.popens don't expose the return code, or immediately flush
> stderr, which I'm doing for git commands potentially writing progress info.
> The previous implementation defined its own popen in util, but just making
> the arguments to subprocess explicit seems simpler.

Fair enough, seems reasonable. Can you note something along those lines in a brief comment?



More information about the Mercurial-devel mailing list