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

login
register
mail settings
Submitter Jun Wu
Date April 10, 2016, 11:57 p.m.
Message ID <9cf8e7497c267cfaea5b.1460332648@x1c>
Download mbox | patch
Permalink /patch/14509/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Jun Wu - April 10, 2016, 11:57 p.m.
# HG changeset patch
# User Jun Wu <quark@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.
timeless - April 11, 2016, 3:41 a.m.
Jun Wu wrote:
> +        The $path mentioned above are relative to the current directory of
> +        server address.

path is singular. I'd expect "is" instead of "are".

I don't understand what "the current directory server address" is/means.
Yuya Nishihara - April 13, 2016, 3:17 p.m.
On Mon, 11 Apr 2016 00:57:28 +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1460330769 -3600
> #      Mon Apr 11 00:26:09 2016 +0100
> # Node ID 9cf8e7497c267cfaea5baa8913f5665ab44867ec
> # Parent  1b8ee8aabe42b44cd865d41bf095c2cf7892e4dc
> chgserver: return relative paths in validate

Looks okay, but this should come after the unlinkat() patch. Please resend
with V2.

Patch

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.