[PATCH 1 of 3 hglib] client: extract stub to read server's stderr on close()

Yuya Nishihara yuya at tcha.org
Wed Sep 9 15:35:15 UTC 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1441632419 -32400
#      Mon Sep 07 22:26:59 2015 +0900
# Node ID 37004f608c73fccf1750d42037b37fea3082aa67
# Parent  bfdc96f223210867f0f6752700e16eddf2c9224a
client: extract stub to read server's stderr on close()

New _close() function will return (returncode, stderr) pair so that detailed
error message can be obtained.

diff --git a/hglib/client.py b/hglib/client.py
--- a/hglib/client.py
+++ b/hglib/client.py
@@ -200,6 +200,9 @@ class hgclient(object):
         Attempting to call any function afterwards that needs to
         communicate with the server will raise a ValueError.
         """
+        return self._close()
+
+    def _close(self):
         self.server.stdin.close()
         self.server.wait()
         ret = self.server.returncode


More information about the Mercurial-devel mailing list