Page MenuHomePhabricator

chg: switch to using global `environ` instead of envp from main
AbandonedPublic

Authored by spectral on Mon, Jan 27, 7:57 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

My followup patch wants to modify the environment before we call setenv on the
chg server process (to add items), and that won't be handled properly if we use
envp (which isn't modified by putenv).

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

spectral created this revision.Mon, Jan 27, 7:57 PM
pulkit added a subscriber: pulkit.Tue, Jan 28, 6:57 AM

I don't know about the code which this series touch, but since D7550 already made to 5.3rc, should this series be targeted for stable branch?

yuja added a subscriber: yuja.Tue, Jan 28, 11:10 AM

{

	if (getenv("CHGDEBUG"))
		enabledebugmsg();

@@ -429,7 +431,7 @@

		hgc = connectcmdserver(&opts);
		if (!hgc)
			abortmsg("cannot open hg client");
  • hgc_setenv(hgc, envp);

+ hgc_setenv(hgc);

I prefer passing in (const char**)environ to hgc_setenv().

spectral updated this revision to Diff 19655.Tue, Jan 28, 1:56 PM

I prefer passing in (const char**)environ to hgc_setenv().

Done.

spectral updated this revision to Diff 19657.Tue, Jan 28, 1:57 PM

Queuing based on @yuja's review.

Queuing based on @yuja's review.

Actually, since there's no point with this patch without the child, I'll wait until @spectral and @yuja have agreed what to do with that one first.

spectral abandoned this revision.Tue, Feb 4, 4:57 PM