Patchwork chgserver: drop bundle.mainreporoot config

login
register
mail settings
Submitter Jun Wu
Date March 20, 2016, 10:21 p.m.
Message ID <ded4b9e3e2ed6c7522b7.1458512511@x1c>
Download mbox | patch
Permalink /patch/13989/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Jun Wu - March 20, 2016, 10:21 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1458511894 25200
#      Sun Mar 20 15:11:34 2016 -0700
# Node ID ded4b9e3e2ed6c7522b7740bb8ae4aa799545976
# Parent  83127a9fe76ea8b9379d9efa3afefff075b4f920
chgserver: drop bundle.mainreporoot config

Before this patch, although chgserver drops repo object by setting it to None,
there is another side effect loading an repo: setting bundle.mainreporoot.

This patch explicitly sets it to empty to undo the side effect. It will make
chg pass test-strip.t.
Yuya Nishihara - March 21, 2016, 12:43 a.m.
On Sun, 20 Mar 2016 15:21:51 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1458511894 25200
> #      Sun Mar 20 15:11:34 2016 -0700
> # Node ID ded4b9e3e2ed6c7522b7740bb8ae4aa799545976
> # Parent  83127a9fe76ea8b9379d9efa3afefff075b4f920
> chgserver: drop bundle.mainreporoot config

Queued this, thanks.

Patch

diff --git a/hgext/chgserver.py b/hgext/chgserver.py
--- a/hgext/chgserver.py
+++ b/hgext/chgserver.py
@@ -640,7 +640,10 @@ 
 
 class chgunixservice(commandserver.unixservice):
     def init(self):
-        self.repo = None
+        if self.repo:
+            # one chgserver can serve multiple repos. drop repo infomation
+            self.ui.setconfig('bundle', 'mainreporoot', '', 'repo')
+            self.repo = None
         self._inithashstate()
         self._checkextensions()
         class cls(AutoExitMixIn, SocketServer.ForkingMixIn,