[PATCH 11 of 14] chgserver: return relative paths in validate

Jun Wu quark at fb.com
Sun Apr 10 19:57:28 EDT 2016


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1460330769 -3600
#      Mon Apr 11 00:26:09 2016 +0100
# Node ID 9cf8e7497c267cfaea5baa8913f5665ab44867ec
# Parent  1b8ee8aabe42b44cd865d41bf095c2cf7892e4dc
chgserver: return relative paths in validate

This is a part of the series to support long socket path. As planned, the
server and the client only talk about relative paths after startup. This
patch changes the paths returned by the "validate" command to be relative.

diff --git a/hgext/chgserver.py b/hgext/chgserver.py
--- a/hgext/chgserver.py
+++ b/hgext/chgserver.py
@@ -351,7 +351,7 @@
         self.clientsock = sock
         self._oldios = []  # original (self.ch, ui.fp, fd) before "attachio"
         self.hashstate = hashstate
-        self.baseaddress = baseaddress
+        self.baseaddress = os.path.basename(baseaddress)
         if hashstate is not None:
             self.capabilities = self.capabilities.copy()
             self.capabilities['validate'] = chgcmdserver.validate
@@ -443,6 +443,8 @@
               This may happen if we cannot parse the config.
             - "reconnect", the client should close the connection and
               reconnect.
+        The $path mentioned above are relative to the current directory of
+        server address.
         If neither "reconnect" nor "redirect" is included in the instruction
         list, the client can continue with this server after completing all
         the instructions.


More information about the Mercurial-devel mailing list