diff mercurial/localrepo.py @ 22950:bb8278b289ee

obsolete: add readonly flag to obstore constructor Previously, obstore read the obsolete._enabled flag to determine whether to allow writes to the obstore. Since obsolete._enabled will be moving into a repo specific config, we can't read it globally, and therefore must pass the information into the constructor.
author Durham Goode <durham@fb.com>
date Tue, 14 Oct 2014 13:20:31 -0700
parents c136e26953aa
children 6c86c673dde6
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Oct 14 13:17:35 2014 -0700
+++ b/mercurial/localrepo.py	Tue Oct 14 13:20:31 2014 -0700
@@ -406,7 +406,8 @@
         kwargs = {}
         if defaultformat is not None:
             kwargs['defaultformat'] = defaultformat
-        store = obsolete.obsstore(self.sopener, **kwargs)
+        store = obsolete.obsstore(self.sopener, readonly=not obsolete._enabled,
+                                  **kwargs)
         if store and not obsolete._enabled:
             # message is rare enough to not be translated
             msg = 'obsolete feature not enabled but %i markers found!\n'