This is an archive of the discontinued Mercurial Phabricator instance.

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

Authored by spectral on Jan 27 2020, 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.Jan 27 2020, 7:57 PM
pulkit added a subscriber: pulkit.Jan 28 2020, 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.Jan 28 2020, 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.Jan 28 2020, 1:56 PM

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

Done.

spectral updated this revision to Diff 19657.Jan 28 2020, 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.Feb 4 2020, 4:57 PM