##// END OF EJS Templates
registrar: move "constant" possiblecmdtypes to class level...
Martin von Zweigbergk -
r34896:7b857c59 default
parent child Browse files
Show More
@@ -148,13 +148,13 b' class command(_funcregistrarbase):'
148 recoverablewrite = "recoverable"
148 recoverablewrite = "recoverable"
149 readonly = "readonly"
149 readonly = "readonly"
150
150
151 possiblecmdtypes = {unrecoverablewrite, recoverablewrite, readonly}
152
151 def _doregister(self, func, name, options=(), synopsis=None,
153 def _doregister(self, func, name, options=(), synopsis=None,
152 norepo=False, optionalrepo=False, inferrepo=False,
154 norepo=False, optionalrepo=False, inferrepo=False,
153 cmdtype=unrecoverablewrite):
155 cmdtype=unrecoverablewrite):
154
156
155 possiblecmdtypes = set([self.unrecoverablewrite, self.recoverablewrite,
157 if cmdtype not in self.possiblecmdtypes:
156 self.readonly])
157 if cmdtype not in possiblecmdtypes:
158 raise error.ProgrammingError(_("unknown cmdtype value '%s' for "
158 raise error.ProgrammingError(_("unknown cmdtype value '%s' for "
159 "'%s' command") % (cmdtype, name))
159 "'%s' command") % (cmdtype, name))
160 func.norepo = norepo
160 func.norepo = norepo
General Comments 0
You need to be logged in to leave comments. Login now