# HG changeset patch # User Jun Wu # Date 1457954584 0 # Node ID 0747ef2c4ab25e6f0928143217588ad4f6698d9c # Parent 859af6e78368600f724ccc26397ec30b145bffdb chgserver: resolve relative path before sending via system channel The chgserver may have a different cwd from the client because of the side effect of "--cwd" and other possible os.chdir done by extensions. Therefore relative paths can be misunderstood by the client. This patch solves it by expanding relative cwd path to absolute one before sending them via the 'S' channel. It can help chg to pass a testcase in test-alias.t later. diff -r 859af6e78368 -r 0747ef2c4ab2 hgext/chgserver.py --- a/hgext/chgserver.py Sat Mar 12 13:19:19 2016 -0800 +++ b/hgext/chgserver.py Mon Mar 14 11:23:04 2016 +0000 @@ -314,7 +314,7 @@ self.channel = channel def __call__(self, cmd, environ, cwd): - args = [util.quotecommand(cmd), cwd or '.'] + args = [util.quotecommand(cmd), os.path.abspath(cwd or '.')] args.extend('%s=%s' % (k, v) for k, v in environ.iteritems()) data = '\0'.join(args) self.out.write(struct.pack('>cI', self.channel, len(data)))