Patchwork [3,of,4] lfs: register config options

login
register
mail settings
Submitter Matt Harbison
Date Nov. 15, 2017, 3:17 a.m.
Message ID <6492bdc8a9b8a6304b0f.1510715879@Envy>
Download mbox | patch
Permalink /patch/25565/
State Accepted
Headers show

Comments

Matt Harbison - Nov. 15, 2017, 3:17 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1510639402 18000
#      Tue Nov 14 01:03:22 2017 -0500
# Node ID 6492bdc8a9b8a6304b0fe658d58b5b286043a88f
# Parent  fce924e1066b338944c4a4913b236cd39a1c4a40
lfs: register config options

I'm not sure at what point we can get rid of the deprecated options, but for the
sake of making progress, they are registered too.

Patch

diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -54,6 +54,31 @@ 
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('lfs', 'url',
+    default=configitem.dynamicdefault,
+)
+configitem('lfs', 'threshold',
+    default=None,
+)
+configitem('lfs', 'retry',
+    default=5,
+)
+# Deprecated
+configitem('lfs', 'remotestore',
+    default=None,
+)
+# Deprecated
+configitem('lfs', 'dummy',
+    default=None,
+)
+# Deprecated
+configitem('lfs', 'git-lfs',
+    default=None,
+)
+
 cmdtable = {}
 command = registrar.command(cmdtable)
 
@@ -64,7 +89,7 @@ 
     if not repo.local():
         return
 
-    threshold = repo.ui.configbytes('lfs', 'threshold', None)
+    threshold = repo.ui.configbytes('lfs', 'threshold')
 
     repo.svfs.options['lfsthreshold'] = threshold
     repo.svfs.lfslocalblobstore = blobstore.local(repo)
diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py
+++ b/hgext/lfs/blobstore.py
@@ -91,7 +91,7 @@ 
         baseurl, authinfo = url.authinfo()
         self.baseurl = baseurl.rstrip('/')
         self.urlopener = urlmod.opener(ui, authinfo)
-        self.retry = ui.configint('lfs', 'retry', 5)
+        self.retry = ui.configint('lfs', 'retry')
 
     def writebatch(self, pointers, fromstore):
         """Batch upload from local to remote blobstore."""