Mercurial > public > mercurial-scm > hg
comparison contrib/phabricator.py @ 38042:5a7cf42ba6ef
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`).
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 16 May 2018 22:44:27 -0400 |
parents | 71cf20d47f25 |
children | bb7e3c6ef592 |
comparison
equal
deleted
inserted
replaced
38041:242eb5132203 | 38042:5a7cf42ba6ef |
---|---|
70 stringutil, | 70 stringutil, |
71 ) | 71 ) |
72 | 72 |
73 cmdtable = {} | 73 cmdtable = {} |
74 command = registrar.command(cmdtable) | 74 command = registrar.command(cmdtable) |
75 | |
76 configtable = {} | |
77 configitem = registrar.configitem(configtable) | |
78 | |
79 # developer config: phabricator.batchsize | |
80 configitem('phabricator', 'batchsize', | |
81 default=12, | |
82 ) | |
83 configitem('phabricator', 'callsign', | |
84 default=None, | |
85 ) | |
86 configitem('phabricator', 'curlcmd', | |
87 default=None, | |
88 ) | |
89 # developer config: phabricator.repophid | |
90 configitem('phabricator', 'repophid', | |
91 default=None, | |
92 ) | |
93 configitem('phabricator', 'url', | |
94 default=None, | |
95 ) | |
96 configitem('phabsend', 'confirm', | |
97 default=False, | |
98 ) | |
75 | 99 |
76 colortable = { | 100 colortable = { |
77 'phabricator.action.created': 'green', | 101 'phabricator.action.created': 'green', |
78 'phabricator.action.skipped': 'magenta', | 102 'phabricator.action.skipped': 'magenta', |
79 'phabricator.action.updated': 'magenta', | 103 'phabricator.action.updated': 'magenta', |
748 | 772 |
749 tree = _parse(spec) | 773 tree = _parse(spec) |
750 drevs, ancestordrevs = _prefetchdrevs(tree) | 774 drevs, ancestordrevs = _prefetchdrevs(tree) |
751 | 775 |
752 # developer config: phabricator.batchsize | 776 # developer config: phabricator.batchsize |
753 batchsize = repo.ui.configint('phabricator', 'batchsize', 12) | 777 batchsize = repo.ui.configint('phabricator', 'batchsize') |
754 | 778 |
755 # Prefetch Differential Revisions in batch | 779 # Prefetch Differential Revisions in batch |
756 tofetch = set(drevs) | 780 tofetch = set(drevs) |
757 for r in ancestordrevs: | 781 for r in ancestordrevs: |
758 tofetch.update(range(max(1, r - batchsize), r + 1)) | 782 tofetch.update(range(max(1, r - batchsize), r + 1)) |