Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.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 | f962870712da |
children | cf3b8285af00 |
comparison
equal
deleted
inserted
replaced
20081:93f9d11603d8 | 20082:b04cc8651a63 |
---|---|
169 self.auditor = pathutil.pathauditor(self.root, self._checknested) | 169 self.auditor = pathutil.pathauditor(self.root, self._checknested) |
170 self.vfs = scmutil.vfs(self.path) | 170 self.vfs = scmutil.vfs(self.path) |
171 self.opener = self.vfs | 171 self.opener = self.vfs |
172 self.baseui = baseui | 172 self.baseui = baseui |
173 self.ui = baseui.copy() | 173 self.ui = baseui.copy() |
174 self.ui.copy = baseui.copy # prevent copying repo configuration | |
174 # A list of callback to shape the phase if no data were found. | 175 # A list of callback to shape the phase if no data were found. |
175 # Callback are in the form: func(repo, roots) --> processed root. | 176 # Callback are in the form: func(repo, roots) --> processed root. |
176 # This list it to be filled by extension during repo setup | 177 # This list it to be filled by extension during repo setup |
177 self._phasedefaults = [] | 178 self._phasedefaults = [] |
178 try: | 179 try: |