D6327: gendoc: guarantee that all commands were processed

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat May 4 12:31:05 EDT 2019


martinvonz added inline comments.

INLINE COMMENTS

> Sietse wrote in gendoc.py:200
> It doesn't error out, I checked before uploading. Debug commands have CATEGORY_NONE; see also below.
> 
> The purpose of this patch is to give confidence that no commands got 'lost' as we moved from 'process every command' (which guarantees every commands gets processed) to 'process every registered category' (where commands can get skipped if their category isn't registered).
> 
> The previous version of this patch compared an expected list of commands to a log of processed commands. Because the main command-rendering loop skipped debug commands, I manually removed them from the expected list, too. That's why it ignored debug commands.
> 
> The current version of this patch checks at command-sorting time that every command is part of a registered category. Commands with no category (such as debug commands) get sorted into `CATEGORY_NONE`, which is a known category displayed as "Uncategorized commands". We've guaranteed that the command-rendering loop will see every command, and what it skips or keeps is up to the rendering logic.

> The previous version of this patch compared an expected list of commands to a log of processed commands. Because the main command-rendering loop skipped debug commands, I manually removed them from the expected list, too. That's why it ignored debug commands.

Ah, that makes sense.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6327

To: Sietse, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel


More information about the Mercurial-devel mailing list