[PATCH evolve-ext] directaccess: add some commands to the directaccess list

Laurent Charignon lcharignon at fb.com
Wed Jun 17 12:32:55 CDT 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1434562207 25200
#      Wed Jun 17 10:30:07 2015 -0700
# Node ID 68f227801c95406329177460f6f6888e3ad6a0e2
# Parent  c02cdb97ebfa29c0df40417db9e36f31f2977b4b
directaccess: add some commands to the directaccess list

Before this patch we had a limited list of commands in the directaccess list.
This patch adds about 20 commands to that list:
- all the read-only commands in core supporting a rev as an argument
- 'outgoing': since people can use 'outgoing' to know what is going to be
pushed, the output of hg outgoing should be consistent with to the output
of hg push and must therefore disallow directaccess since hg push forbids it.

diff --git a/hgext/directaccess.py b/hgext/directaccess.py
--- a/hgext/directaccess.py
+++ b/hgext/directaccess.py
@@ -21,12 +21,46 @@ command = cmdutil.command(cmdtable)
 # By default, all the commands have directaccess with warnings
 # List of commands that have no directaccess and directaccess with no warning
 directaccesslevel = [
-    # 'nowarning' or 'error', (None if core) or extension name, command name
+    # Format:
+    # ('nowarning', 'evolve', 'prune'),
+    # means: no directaccess warning, for the command in evolve named prune
+    #
+    # ('error', None, 'serve'),
+    # means: no directaccess for the command in core named serve
+    #
+    # The list is ordered alphabetically by command names, starting with all
+    # the commands in core then all the commands in the extensions
+    #
+    # The general guideline is:
+    # - remove directaccess warnings for read only commands
+    # - no direct access for commands with consequences outside of the repo
+    # - leave directaccess warnings for all the other commands
+    #
+    ('nowarning', None, 'annotate'),
+    ('nowarning', None, 'archive'),
+    ('nowarning', None, 'backout'),
+    ('nowarning', None, 'bisect'),
+    ('nowarning', None, 'bookmarks'),
+    ('nowarning', None, 'bundle'),
+    ('nowarning', None, 'cat'),
+    ('nowarning', None, 'diff'),
+    ('nowarning', None, 'export'),
+    ('nowarning', None, 'identify'),
+    ('nowarning', None, 'import'),
+    ('nowarning', None, 'incoming'),
+    ('nowarning', None, 'log'),
+    ('nowarning', None, 'manifest'),
+    ('error', None, 'outgoing'), # confusing if push errors and not outgoing
+    ('nowarning', None, 'phase'),
+    ('error', None, 'push'), # destructive
+    ('nowarning', None, 'revert'),
+    ('error', None, 'serve'),
+    ('nowarning', None, 'tag'),
+    ('nowarning', None, 'tags'),
+    ('nowarning', None, 'unbundle'),
     ('nowarning', None, 'update'),
-    ('nowarning', None, 'export'),
+    ('nowarning', None, 'verify'),
     ('nowarning',  'evolve', 'prune'),
-    ('error', None, 'push'),
-    ('error', None, 'serve'),
 ]
 
 def reposetup(ui, repo):


More information about the Mercurial-devel mailing list