# HG changeset patch # User Augie Fackler # Date 1508983875 14400 # Node ID ed7c66b8cea69c07dac9404c24fd89121d0bebc1 # Parent 4dad506e51cc36a44c8dda7fe46e526aa12128b6 svnrepo: move password_stores config to a property The config registrar doesn't load extension config values until after a repo is created, meaning you can't access non-core config items in a repository constructor. diff --git a/hgsubversion/svnrepo.py b/hgsubversion/svnrepo.py --- a/hgsubversion/svnrepo.py +++ b/hgsubversion/svnrepo.py @@ -141,14 +141,6 @@ class svnremoterepo(peerrepository): self._capabilities = set(['lookup', 'subversion']) elif peerapi == 0: self.capabilities = set(['lookup', 'subversion']) - pws = self.ui.config('hgsubversion', 'password_stores', None) - if pws is not None: - # Split pws at comas and strip neighbouring whitespace (whitespace - # at the beginning and end of pws has already been removed by the - # config parser). - self.password_stores = re.split(r'\s*,\s*', pws) - else: - self.password_stores = None if peerapi == 1: def capabilities(self): @@ -157,6 +149,16 @@ class svnremoterepo(peerrepository): def _capabilities(self): return self.capabilities + @property + def password_stores(self): + pws = self.ui.config('hgsubversion', 'password_stores', None) + if pws is not None: + # Split pws at comas and strip neighbouring whitespace (whitespace + # at the beginning and end of pws has already been removed by the + # config parser). + return re.split(r'\s*,\s*', pws) + return None + @propertycache def svnauth(self): # DO NOT default the user to hg's getuser(). If you provide