Mercurial > public > mercurial-scm > hg
comparison hgext/phabricator.py @ 44551:9bae1d1a0f4c
phabricator: add a config knob to import in the secret phase
For my use anyway, it's better to have a config knob that's always set than to
try to remember a switch. But we can add a tristate switch if desired.
Differential Revision: https://phab.mercurial-scm.org/D8137
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 16 Feb 2020 17:17:41 -0500 |
parents | bbb170f9396d |
children | f10055b099b3 |
comparison
equal
deleted
inserted
replaced
44550:bbb170f9396d | 44551:9bae1d1a0f4c |
---|---|
122 b'phabricator', b'url', default=None, | 122 b'phabricator', b'url', default=None, |
123 ) | 123 ) |
124 eh.configitem( | 124 eh.configitem( |
125 b'phabsend', b'confirm', default=False, | 125 b'phabsend', b'confirm', default=False, |
126 ) | 126 ) |
127 eh.configitem( | |
128 b'phabimport', b'secret', default=False, | |
129 ) | |
127 | 130 |
128 colortable = { | 131 colortable = { |
129 b'phabricator.action.created': b'green', | 132 b'phabricator.action.created': b'green', |
130 b'phabricator.action.skipped': b'magenta', | 133 b'phabricator.action.skipped': b'magenta', |
131 b'phabricator.action.updated': b'magenta', | 134 b'phabricator.action.updated': b'magenta', |
1727 opts[b'strip'] = 1 | 1730 opts[b'strip'] = 1 |
1728 opts[b'prefix'] = b'' | 1731 opts[b'prefix'] = b'' |
1729 # Evolve 9.3.0 assumes this key is present in cmdutil.tryimportone() | 1732 # Evolve 9.3.0 assumes this key is present in cmdutil.tryimportone() |
1730 opts[b'obsolete'] = False | 1733 opts[b'obsolete'] = False |
1731 | 1734 |
1735 if ui.configbool(b'phabimport', b'secret'): | |
1736 opts[b'secret'] = True | |
1737 | |
1732 def _write(patches): | 1738 def _write(patches): |
1733 parents = repo[None].parents() | 1739 parents = repo[None].parents() |
1734 | 1740 |
1735 with repo.wlock(), repo.lock(), repo.transaction(b'phabimport'): | 1741 with repo.wlock(), repo.lock(), repo.transaction(b'phabimport'): |
1736 for drev, contents in patches: | 1742 for drev, contents in patches: |