[PATCH 1 of 3] commandserver: send pgid in hello message

Jun Wu quark at fb.com
Sun Jul 17 18:09:41 EDT 2016


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1468792565 -3600
#      Sun Jul 17 22:56:05 2016 +0100
# Node ID 2278b2c5638684efdd9d39ad1e1bc2f691f12b1e
# Parent  1cc5a918b7d8acdc918809d74842fecc128c4ec4
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 2278b2c56386
commandserver: send pgid in hello message

See the next patches for why we need it.

diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
--- a/mercurial/commandserver.py
+++ b/mercurial/commandserver.py
@@ -282,6 +282,9 @@ class server(object):
         hellomsg += 'encoding: ' + encoding.encoding
         hellomsg += '\n'
         hellomsg += 'pid: %d' % util.getpid()
+        if util.safehasattr(os, 'getpgid'):
+            hellomsg += '\n'
+            hellomsg += 'pgid: %d' % os.getpgid(0)
 
         # write the hello msg in -one- chunk
         self.cout.write(hellomsg)


More information about the Mercurial-devel mailing list