diff contrib/chg/procutil.c @ 30691:7adb60660496

chg: decouple hgclient from setuppager procutil should not depend on hgclient. This patch makes the pager handling part independent from hgclient.
author Jun Wu <quark@fb.com>
date Mon, 02 Jan 2017 14:10:32 +0000
parents e9ec42634ec8
children 23ddd43ba866
line wrap: on
line diff
--- a/contrib/chg/procutil.c	Mon Jan 02 14:04:35 2017 +0000
+++ b/contrib/chg/procutil.c	Mon Jan 02 14:10:32 2017 +0000
@@ -157,10 +157,8 @@
 
 /* This implementation is based on hgext/pager.py (post 369741ef7253)
  * Return 0 if pager is not started, or pid of the pager */
-static pid_t setuppager(hgclient_t *hgc, const char *const args[],
-		       size_t argsize)
+static pid_t setuppager(const char *pagercmd)
 {
-	const char *pagercmd = hgc_getpager(hgc, args, argsize);
 	if (!pagercmd)
 		return 0;
 
@@ -179,7 +177,6 @@
 				goto error;
 		}
 		close(pipefds[1]);
-		hgc_attachio(hgc);  /* reattach to pager */
 		return pid;
 	} else {
 		dup2(pipefds[0], fileno(stdin));