[PATCH 2 of 9] help: let 'hg help debug' show the list of secret debug commands

Mads Kiilerich mads at kiilerich.com
Wed Mar 19 11:38:08 UTC 2014


On 03/19/2014 03:58 AM, Siddharth Agarwal wrote:
> On 03/18/2014 04:33 PM, Mads Kiilerich wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski at unity3d.com>
>> # Date 1394896444 -3600
>> #      Sat Mar 15 16:14:04 2014 +0100
>> # Node ID ab2a99f9f3396fb705bd621fd5b2de04783ac101
>> # Parent  ffaeeb8d43872aca4c329937b793c6b4919ce192
>> help: let 'hg help debug' show the list of secret debug commands
>>
>> The names of the debug commands are not easy to remember and they are 
>> not easy
>> to find.
>
> hg help --debug?

Yes, that is an alternative.

But:

--debug is not really (besides this) related to the commands that have 
debug in their name. It is thus not that intuitive that --debug means 
that debug commands are shown.

--debug also just shows the extra debug commands in the middle of 
verbose output. Not as convenient.

The existing behaviour was also not consistent:

$ hg c
hg: command 'c' is ambiguous:
     cat checkout clone commit copy

$ hg help c
list of commands:

  cat           output the current or given revision of files
  clone         make a copy of an existing repository
  commit        commit the specified files or all outstanding changes
  copy          mark files as copied for the next commit

use "hg -v help c" to show builtin aliases and global options

$ hg debug
hg: command 'debug' is ambiguous:
     debugancestor debugbuilddag debugbundle debugcheckstate 
debugcommands debugcomplete debugconfig debugdag debugdata debugdate 
debugdirstate debugdiscovery debugfileset debugfsinfo debuggetbundle 
debugignore debugindex debugindexdot debuginstall debugknown 
debuglabelcomplete debugobsolete debugpathcomplete debugpushkey 
debugpvec debugrebuilddirstate debugrename debugrevlog debugrevspec 
debugsetparents debugsub debugsuccessorssets debugwalk debugwireargs

$ hg help debug
no commands defined


I think this simple change makes Mercurial more consistent and 
predictable and is worth it.

/Mads



More information about the Mercurial-devel mailing list