comparison mercurial/commandserver.py @ 20082:b04cc8651a63

localrepo: prevent to copy repo local config, copy baseui instead Copying a repos local configuration to another repo is a bad idea because the 2nd repo gets the configuration of the first. Prevent this by really calling repo.baseui.copy when repo.ui.copy is called. This requires some changes in commandserver which needs to clone repo.ui for rejecting temporary changes. This patch has its roots back in the topic "repo isolation" around f0564402d059 and was suggested by mpm.
author Simon Heimberg <simohe@besonet.ch>
date Mon, 11 Nov 2013 22:59:26 +0100
parents 4b09e6f7d7de
children a42ea6d209e6
comparison
equal deleted inserted replaced
20081:93f9d11603d8 20082:b04cc8651a63
182 182
183 # copy the uis so changes (e.g. --config or --verbose) don't 183 # copy the uis so changes (e.g. --config or --verbose) don't
184 # persist between requests 184 # persist between requests
185 copiedui = self.ui.copy() 185 copiedui = self.ui.copy()
186 self.repo.baseui = copiedui 186 self.repo.baseui = copiedui
187 self.repo.ui = self.repo.dirstate._ui = self.repoui.copy() 187 # clone ui without using ui.copy because this is protected
188 repoui = self.repoui.__class__(self.repoui)
189 repoui.copy = copiedui.copy # redo copy protection
190 self.repo.ui = self.repo.dirstate._ui = repoui
188 self.repo.invalidate() 191 self.repo.invalidate()
189 self.repo.invalidatedirstate() 192 self.repo.invalidatedirstate()
190 193
191 req = dispatch.request(args[:], copiedui, self.repo, self.cin, 194 req = dispatch.request(args[:], copiedui, self.repo, self.cin,
192 self.cout, self.cerr) 195 self.cout, self.cerr)