]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: fix hgpatch on windows
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Thu, 3 Feb 2011 03:43:40 +0000 (22:43 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 3 Feb 2011 03:43:40 +0000 (22:43 -0500)
R=rsc
CC=golang-dev
https://golang.org/cl/3989059

lib/codereview/codereview.py

index cd0c7a8761d1ded5618068221e9dfc747f9c3b1e..94270f840d2e8fd7556576af61a6a1c9b37d914a 100644 (file)
@@ -1142,12 +1142,11 @@ def clpatch(ui, repo, clname, **opts):
        if err != "":
                return err
        try:
-               cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=True)
+               cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=sys.platform != "win32")
        except:
                return "hgpatch: " + ExceptionDetail()
-       if os.fork() == 0:
-               cmd.stdin.write(patch)
-               os._exit(0)
+
+       cmd.stdin.write(patch)
        cmd.stdin.close()
        out = cmd.stdout.read()
        if cmd.wait() != 0 and not opts["ignore_hgpatch_failure"]: