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

login
register
mail settings
Submitter Laurent Charignon
Date June 17, 2015, 5:32 p.m.
Message ID <68f227801c9540632917.1434562375@lcharignon-mbp.local>
Download mbox | patch
Permalink /patch/9693/
State Accepted
Headers show

Comments

Laurent Charignon - June 17, 2015, 5:32 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@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.
Pierre-Yves David - June 17, 2015, 6:31 p.m.
On 06/17/2015 10:32 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@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

Pushed to main after dropping the following commands:

backout
import
prune
verify
phase
tag
Augie Fackler - June 22, 2015, 2:05 p.m.
On Wed, Jun 17, 2015 at 11:31:23AM -0700, Pierre-Yves David wrote:
>
>
> On 06/17/2015 10:32 AM, Laurent Charignon wrote:
> ># HG changeset patch
> ># User Laurent Charignon <lcharignon@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
>
> Pushed to main after dropping the following commands:
>
> backout
> import

Actually, it's pretty painful to try and import something that's
already been pruned if you try to import it such that it becomes the
already-obsolete sha1. Or it used to be, last time I tripped over that.

> prune

I dunno. Maybe let this one through as a noop?

> verify
> phase
> tag
>
> --
> Pierre-Yves David
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Pierre-Yves David - June 22, 2015, 5:03 p.m.
On 06/22/2015 07:05 AM, Augie Fackler wrote:
> On Wed, Jun 17, 2015 at 11:31:23AM -0700, Pierre-Yves David wrote:
>>
>>
>> On 06/17/2015 10:32 AM, Laurent Charignon wrote:
>>> # HG changeset patch
>>> # User Laurent Charignon <lcharignon@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
>>
>> Pushed to main after dropping the following commands:
>>
>> backout
>> import
>
> Actually, it's pretty painful to try and import something that's
> already been pruned if you try to import it such that it becomes the
> already-obsolete sha1. Or it used to be, last time I tripped over that.

This patch is not is not going to change anything but the behavior of 
import --exact when the declared parent is hidden.. fairly corner case.

>> prune
>
> I dunno. Maybe let this one through as a noop?

Current setting is "noop with a warning"

Patch

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):