changeset 35123:07e97998d385

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.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 14 Nov 2017 01:03:22 -0500
parents b8e5fb8d2389
children eb4241f914a3
files hgext/lfs/__init__.py hgext/lfs/blobstore.py
diffstat 2 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/lfs/__init__.py	Tue Nov 14 00:14:52 2017 -0500
+++ b/hgext/lfs/__init__.py	Tue Nov 14 01:03:22 2017 -0500
@@ -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)
--- a/hgext/lfs/blobstore.py	Tue Nov 14 00:14:52 2017 -0500
+++ b/hgext/lfs/blobstore.py	Tue Nov 14 01:03:22 2017 -0500
@@ -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."""