Patchwork chg: just forward --time to command server

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 7, 2017, 1:19 p.m.
Message ID <f2a8ec9a8d9bd7c85e3d.1507382373@mimosa>
Download mbox | patch
Permalink /patch/24626/
State Accepted
Headers show

Comments

Yuya Nishihara - Oct. 7, 2017, 1:19 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1507381630 -32400
#      Sat Oct 07 22:07:10 2017 +0900
# Node ID f2a8ec9a8d9bd7c85e3d605543766c756d898d8f
# Parent  5584116d8f7136476f2ea835277568c372f0c866
chg: just forward --time to command server

Since we've removed the use of atexit in de5c9d0e02ea, --time just works.
Jun Wu - Oct. 7, 2017, 5:37 p.m.
LGTM.

Excerpts from Yuya Nishihara's message of 2017-10-07 22:19:33 +0900:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1507381630 -32400
> #      Sat Oct 07 22:07:10 2017 +0900
> # Node ID f2a8ec9a8d9bd7c85e3d605543766c756d898d8f
> # Parent  5584116d8f7136476f2ea835277568c372f0c866
> chg: just forward --time to command server
> 
> Since we've removed the use of atexit in de5c9d0e02ea, --time just works.
> 
> diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c
> --- a/contrib/chg/chg.c
> +++ b/contrib/chg/chg.c
> @@ -369,7 +369,6 @@ static int isunsupported(int argc, const
>          SERVE = 1,
>          DAEMON = 2,
>          SERVEDAEMON = SERVE | DAEMON,
> -        TIME = 4,
>      };
>      unsigned int state = 0;
>      int i;
> @@ -381,11 +380,8 @@ static int isunsupported(int argc, const
>          else if (strcmp("-d", argv[i]) == 0 ||
>               strcmp("--daemon", argv[i]) == 0)
>              state |= DAEMON;
> -        else if (strcmp("--time", argv[i]) == 0)
> -            state |= TIME;
>      }
> -    return (state & TIME) == TIME ||
> -           (state & SERVEDAEMON) == SERVEDAEMON;
> +    return (state & SERVEDAEMON) == SERVEDAEMON;
>  }
>  
>  static void execoriginalhg(const char *argv[])
Augie Fackler - Oct. 10, 2017, 12:55 a.m.
On Sat, Oct 07, 2017 at 10:19:33PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1507381630 -32400
> #      Sat Oct 07 22:07:10 2017 +0900
> # Node ID f2a8ec9a8d9bd7c85e3d605543766c756d898d8f
> # Parent  5584116d8f7136476f2ea835277568c372f0c866
> chg: just forward --time to command server

queued per junw, thanks

Patch

diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c
--- a/contrib/chg/chg.c
+++ b/contrib/chg/chg.c
@@ -369,7 +369,6 @@  static int isunsupported(int argc, const
 		SERVE = 1,
 		DAEMON = 2,
 		SERVEDAEMON = SERVE | DAEMON,
-		TIME = 4,
 	};
 	unsigned int state = 0;
 	int i;
@@ -381,11 +380,8 @@  static int isunsupported(int argc, const
 		else if (strcmp("-d", argv[i]) == 0 ||
 			 strcmp("--daemon", argv[i]) == 0)
 			state |= DAEMON;
-		else if (strcmp("--time", argv[i]) == 0)
-			state |= TIME;
 	}
-	return (state & TIME) == TIME ||
-	       (state & SERVEDAEMON) == SERVEDAEMON;
+	return (state & SERVEDAEMON) == SERVEDAEMON;
 }
 
 static void execoriginalhg(const char *argv[])