comparison hgext/directaccess.py @ 1371:30d42079f4a2

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.
author Laurent Charignon <lcharignon@fb.com>
date Wed, 17 Jun 2015 10:30:07 -0700
parents c02cdb97ebfa
children 7023a01b9007
comparison
equal deleted inserted replaced
1370:0799c5831a3d 1371:30d42079f4a2
19 command = cmdutil.command(cmdtable) 19 command = cmdutil.command(cmdtable)
20 20
21 # By default, all the commands have directaccess with warnings 21 # By default, all the commands have directaccess with warnings
22 # List of commands that have no directaccess and directaccess with no warning 22 # List of commands that have no directaccess and directaccess with no warning
23 directaccesslevel = [ 23 directaccesslevel = [
24 # 'nowarning' or 'error', (None if core) or extension name, command name 24 # Format:
25 # ('nowarning', 'evolve', 'prune'),
26 # means: no directaccess warning, for the command in evolve named prune
27 #
28 # ('error', None, 'serve'),
29 # means: no directaccess for the command in core named serve
30 #
31 # The list is ordered alphabetically by command names, starting with all
32 # the commands in core then all the commands in the extensions
33 #
34 # The general guideline is:
35 # - remove directaccess warnings for read only commands
36 # - no direct access for commands with consequences outside of the repo
37 # - leave directaccess warnings for all the other commands
38 #
39 ('nowarning', None, 'annotate'),
40 ('nowarning', None, 'archive'),
41 ('nowarning', None, 'bisect'),
42 ('nowarning', None, 'bookmarks'),
43 ('nowarning', None, 'bundle'),
44 ('nowarning', None, 'cat'),
45 ('nowarning', None, 'diff'),
46 ('nowarning', None, 'export'),
47 ('nowarning', None, 'identify'),
48 ('nowarning', None, 'import'),
49 ('nowarning', None, 'incoming'),
50 ('nowarning', None, 'log'),
51 ('nowarning', None, 'manifest'),
52 ('error', None, 'outgoing'), # confusing if push errors and not outgoing
53 ('error', None, 'push'), # destructive
54 ('nowarning', None, 'revert'),
55 ('error', None, 'serve'),
56 ('nowarning', None, 'tags'),
57 ('nowarning', None, 'unbundle'),
25 ('nowarning', None, 'update'), 58 ('nowarning', None, 'update'),
26 ('nowarning', None, 'export'),
27 ('nowarning', 'evolve', 'prune'),
28 ('error', None, 'push'),
29 ('error', None, 'serve'),
30 ] 59 ]
31 60
32 def reposetup(ui, repo): 61 def reposetup(ui, repo):
33 repo._explicitaccess = set() 62 repo._explicitaccess = set()
34 63