D612: directaccess: add a accesslevel argument to registrar.command

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat Sep 2 15:37:33 UTC 2017


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

REVISION SUMMARY
  The accesslevel argument as stated in the doc can have three possible values
  0,1 and 2 which will represent the access level they have to hidden commits.
  
  Thanks to Augie for suggesting the directaccess level in @command decorator.

REPOSITORY
  rHG Mercurial

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

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
@@ -132,10 +132,19 @@
     command line arguments. If True, arguments will be examined for potential
     repository locations. See ``findrepo()``. If a repository is found, it
     will be used.
+
+    The accesslevel argument defines what level of access on hidden commits
+    the command has. The argument can have three possible values: 0,1 and 2
+    where
+        0: Can't access the hidden commits (unrecoverable write command)
+        1: Can acces the hidden commits but should print warnings
+            (recoverable write command)
+        2: Can access the hidden commits without any warnings (read command)
     """
 
     def _doregister(self, func, name, options=(), synopsis=None,
-                    norepo=False, optionalrepo=False, inferrepo=False):
+                    norepo=False, optionalrepo=False, inferrepo=False,
+                    accesslevel=0):
         func.norepo = norepo
         func.optionalrepo = optionalrepo
         func.inferrepo = inferrepo



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


More information about the Mercurial-devel mailing list