Note:

This page is primarily intended for developers of Mercurial.

Command NameSpace

Status: In Progress

Main proponents: Pierre-YvesDavid

/!\ This is a speculative project and does not represent any firm decisions on future behavior.

Introduce official namespaces for commands (like normal, perf, debug, admin, etc…)

1. Goal

Explain what kind of problem are triggering this idea, why it is worth solving and the big picture of how you'll solve it.

As of Mercurial 5.6 we have a few command implicit "namespace"

The current "debug" namespace is problematic because it mix:

So the idea it to:

Introduce official namespace notation hg namespace-command and "move" command into a limited but meaningful number of namespace.

2. Detailed description

It is important to note that the namespace plan aims at separating command into very high level category (command for users, admin, scrip, mercurial-developer, etc), and is not to be used for more detailled categories (eg: the helpcategory parameters of command, a phab- namespace, etc…). Mixing the two would mud the water and reduce the importance of the semantic barrier between the currently proposed

However, being able to use - in command name would be handy. They could use use for both "soft" namespacing (eg phab-, narrow-, …) and readability (eg: update-cache, upgrade-repo, add-remove, …).

So, should we aims at a different syntax for namespace than the simple group-commandwithnospace ? Here is a couple of idea:

Current idea for namespace we know we need

Tentative namespace

command

possible new namespace

notes

verify

admin

recover

admin

rollback

admin (or maybe footgun)

this one is already (DEPRECATED) (DANGEROUS), but could make sense in that admin namespace

serve

(not really) admin

if we had the namespace for a while and hg serve were landing today, it might make sense, but that is a bit late

root

(maybe) script

not really convinced, but playing with ideas. the command is probably fine as it is

command

extensions

possible new namespace

notes

censor

censor

admin

lfconvert

largefile

admin

relink

relink

admin

gc

remotefilelog

admin

repack

remotefilelog

admin

verify

remotefilelog

admin

convert

convert

admin

fastexport

fastexport

admin

command

possible new namespace

new name (namespace syntax not decided)

notes

debugantivirusrunning

admin

admin--is-antivirus-running

debugapplystreamclonebundle

admin

admin--apply-stream-bundle

(Maybe actually not ready to be used)

debugcreatestreamclonebundle

admin

admin--creates-stream-bundle

(Maybe actually not ready to be used)

debugbackupbundle

admin

admin--list-backup-bundles

debugnodemap

admin (part of it)

partially merged in admin--verify (and admin--rebuild-cache?)

debugcheckstate

admin

merged into admin--verify

debugcolor

admin

admin--color-info

debugfsinfo

admin

admin--fs-info

debuginstall

admin

admin--install-info

debuglocks

admin

admin--locks

debugrebuilddirstate

admin

merged into admin--rebuild-cache

debugrebuildfncache

admin

merged into admin--rebuild-cache

debugupdatecaches

admin

admin--rebuild-cache (with flags?)

debugformat

admin

admin--format

debugupgraderepo

admin

merged into admin--format

debugcommands

script

script--complete-command-name

debugcomplete

script

script--complete-command-args

debugnamecomplete

script

script--complete-name

debugpathcomplete

script

script--complete-path

3. Roadmap


CategoryDeveloper CategoryNewFeatures

CommandNameSpacePlan (last edited 2020-12-07 21:56:03 by Pierre-YvesDavid)