D696: registrar: add a enum 'cmdtype' for the type of the command

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Wed Sep 13 12:33:45 UTC 2017


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This patch adds a new enum 'cmdtype' which will tell about the type of the
  command that whether it's a read only command, it's recoverable write command or
  an unrecoverable write command.
  
  This will be used in deciding which level of hidden access a command can has.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D696

AFFECTED FILES
  mercurial/registrar.py

CHANGE DETAILS

diff --git a/mercurial/registrar.py b/mercurial/registrar.py
--- a/mercurial/registrar.py
+++ b/mercurial/registrar.py
@@ -145,6 +145,14 @@
             self._table[name] = func, list(options)
         return func
 
+class cmdtype(object):
+    """ enum for the type of command which will tell whether the command is
+    write, if so either recoverable or unrecoverable or just read only
+    """
+    UNRECOVERABLE_WRITE = "unrecoverable"
+    RECOVERABLE_WRITE = "recoverable"
+    READ_ONLY = "readonly"
+
 class revsetpredicate(_funcregistrarbase):
     """Decorator to register revset predicate
 



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list