Patchwork D2680: [PoC] obsolete: make markers database writable if local-only mode enabled

login
register
mail settings
Submitter phabricator
Date March 5, 2018, 12:43 a.m.
Message ID <differential-rev-PHID-DREV-zsgc2jwbdrubnfnxe3yu-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29030/
State New
Headers show

Comments

phabricator - March 5, 2018, 12:43 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2680

AFFECTED FILES
  mercurial/obsolete.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -783,7 +783,9 @@ 
     kwargs = {}
     if defaultformat is not None:
         kwargs[r'defaultformat'] = defaultformat
-    readonly = not isenabled(repo, createmarkersopt)
+
+    obsopts = getoptions(repo)
+    readonly = not obsopts[createmarkersopt] and not obsopts[localonlymodeopt]
     store = obsstore(repo.svfs, readonly=readonly, **kwargs)
     if store and readonly:
         ui.warn(_('obsolete feature not enabled but %i markers found!\n')