RFC: Alternative for exemaker

Adrian Buehlmann adrian at cadifra.com
Sat Jun 23 13:45:52 CDT 2012


On 2012-06-23 19:31, Andrei Polushin wrote:
> 23.06.2012 18:59, Adrian Buehlmann wrote:
>> +	/* 
>> +	Add the scriptname, if it's not already there. It may already be
>> +	there, if mercurial spawned a child process of itself, in the same way
>> +	as it got called, that is, with the scriptname already in place. So
>> +	we optionally accept the scriptname as the first argument, letting
>> +	our exe taking the role of the python interpreter.
>> +	*/
>> +	if (argc > 0 && strcmp(argv[1], scriptname) != 0) {
>> +		pyargv[n++] = scriptname;
>> +	}
>> +
>> +	/* copy remaining args from the command line */
> 
> It looks like there no need to copy argv in case when argv[1] is the same
> string as the scriptname, you may just return Py_Main(argc, argv).

Right, thanks.

I've removed the Py_Initialize() call (in e470fa125f84), as you said earlier
today, and pushed ef865a2a2469 [1] in reply to this remark here.

I'm still looking into your other changes.

[1] https://bitbucket.org/abuehl/hgexe/changeset/ef865a2a2469/raw



More information about the Mercurial-devel mailing list