Skip to content
Snippets Groups Projects
Commit 7b857c59 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

registrar: move "constant" possiblecmdtypes to class level

While at it, switch to set literal syntax.

Differential Revision: https://phab.mercurial-scm.org/D1187
parent b63a7d83
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,9 @@
recoverablewrite = "recoverable"
readonly = "readonly"
possiblecmdtypes = {unrecoverablewrite, recoverablewrite, readonly}
def _doregister(self, func, name, options=(), synopsis=None,
norepo=False, optionalrepo=False, inferrepo=False,
cmdtype=unrecoverablewrite):
......@@ -151,10 +153,8 @@
def _doregister(self, func, name, options=(), synopsis=None,
norepo=False, optionalrepo=False, inferrepo=False,
cmdtype=unrecoverablewrite):
possiblecmdtypes = set([self.unrecoverablewrite, self.recoverablewrite,
self.readonly])
if cmdtype not in possiblecmdtypes:
if cmdtype not in self.possiblecmdtypes:
raise error.ProgrammingError(_("unknown cmdtype value '%s' for "
"'%s' command") % (cmdtype, name))
func.norepo = norepo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment