phabricator: register config settings
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 16 May 2018 22:44:27 -0400
changeset 38042 5a7cf42ba6ef
parent 38041 242eb5132203
child 38043 5989261a8356
phabricator: register config settings I didn't bother registering the deprecated phabricator.auth.*, and I'm not sure if the two flagged as 'developer config' should be moved to [devel] (or why there's a distinction between `repophid` and `callsign`).
contrib/phabricator.py
--- a/contrib/phabricator.py	Wed May 16 14:11:41 2018 -0600
+++ b/contrib/phabricator.py	Wed May 16 22:44:27 2018 -0400
@@ -73,6 +73,30 @@
 cmdtable = {}
 command = registrar.command(cmdtable)
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+# developer config: phabricator.batchsize
+configitem('phabricator', 'batchsize',
+    default=12,
+)
+configitem('phabricator', 'callsign',
+    default=None,
+)
+configitem('phabricator', 'curlcmd',
+    default=None,
+)
+# developer config: phabricator.repophid
+configitem('phabricator', 'repophid',
+    default=None,
+)
+configitem('phabricator', 'url',
+    default=None,
+)
+configitem('phabsend', 'confirm',
+    default=False,
+)
+
 colortable = {
     'phabricator.action.created': 'green',
     'phabricator.action.skipped': 'magenta',
@@ -750,7 +774,7 @@
     drevs, ancestordrevs = _prefetchdrevs(tree)
 
     # developer config: phabricator.batchsize
-    batchsize = repo.ui.configint('phabricator', 'batchsize', 12)
+    batchsize = repo.ui.configint('phabricator', 'batchsize')
 
     # Prefetch Differential Revisions in batch
     tofetch = set(drevs)