Patchwork [3,of,4] chg: use --daemon-postexec chdir:/ instead of --cwd /

login
register
mail settings
Submitter Jun Wu
Date March 9, 2016, 2:23 a.m.
Message ID <e18454eee99d96f1dc16.1457490205@x1c>
Download mbox | patch
Permalink /patch/13698/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Jun Wu - March 9, 2016, 2:23 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1457486457 0
#      Wed Mar 09 01:20:57 2016 +0000
# Node ID e18454eee99d96f1dc16833c98951cadc50a3b1c
# Parent  671eb2d843fbac71cbaaaae875985941e920ed2a
chg: use --daemon-postexec chdir:/ instead of --cwd /

The chgserver is designed to load repo config from current directory. "--cwd /"
will prevent chgserver from loading repo config and generate a wrong
confighash, which will result in a redirect loop. This patch removes "--cwd /"
and use "--daemon-postexec chdir:/" instead.

Patch

diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c
--- a/contrib/chg/chg.c
+++ b/contrib/chg/chg.c
@@ -211,10 +211,9 @@ 
 	const char *baseargv[] = {
 		hgcmd,
 		"serve",
-		"--cwd", "/",
 		"--cmdserver", "chgunix",
 		"--address", opts->sockname,
-		"--daemon-postexec", "none",
+		"--daemon-postexec", "chdir:/",
 		"--pid-file", opts->pidfile,
 		"--config", "extensions.chgserver=",
 	};