comparison hgext/phabricator.py @ 44552:f10055b099b3

phabricator: add a config knob to create obsolete markers when importing This too can get a tristate switch if desired. But if so, that needs to happen by having evolve add the option. Differential Revision: https://phab.mercurial-scm.org/D8138
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 16 Feb 2020 17:47:20 -0500
parents 9bae1d1a0f4c
children 3aab524a8480
comparison
equal deleted inserted replaced
44551:9bae1d1a0f4c 44552:f10055b099b3
125 b'phabsend', b'confirm', default=False, 125 b'phabsend', b'confirm', default=False,
126 ) 126 )
127 eh.configitem( 127 eh.configitem(
128 b'phabimport', b'secret', default=False, 128 b'phabimport', b'secret', default=False,
129 ) 129 )
130 eh.configitem(
131 b'phabimport', b'obsolete', default=False,
132 )
130 133
131 colortable = { 134 colortable = {
132 b'phabricator.action.created': b'green', 135 b'phabricator.action.created': b'green',
133 b'phabricator.action.skipped': b'magenta', 136 b'phabricator.action.skipped': b'magenta',
134 b'phabricator.action.updated': b'magenta', 137 b'phabricator.action.updated': b'magenta',
1732 # Evolve 9.3.0 assumes this key is present in cmdutil.tryimportone() 1735 # Evolve 9.3.0 assumes this key is present in cmdutil.tryimportone()
1733 opts[b'obsolete'] = False 1736 opts[b'obsolete'] = False
1734 1737
1735 if ui.configbool(b'phabimport', b'secret'): 1738 if ui.configbool(b'phabimport', b'secret'):
1736 opts[b'secret'] = True 1739 opts[b'secret'] = True
1740 if ui.configbool(b'phabimport', b'obsolete'):
1741 opts[b'obsolete'] = True # Handled by evolve wrapping tryimportone()
1737 1742
1738 def _write(patches): 1743 def _write(patches):
1739 parents = repo[None].parents() 1744 parents = repo[None].parents()
1740 1745
1741 with repo.wlock(), repo.lock(), repo.transaction(b'phabimport'): 1746 with repo.wlock(), repo.lock(), repo.transaction(b'phabimport'):