D6327: gendoc: guarantee that all commands were processed
Sietse (Sietse Brouwer)
phabricator at mercurial-scm.org
Sat May 4 12:02:14 EDT 2019
Sietse marked 2 inline comments as done.
Sietse added inline comments.
> martinvonz wrote in gendoc.py:200
> I think a previous version of this patch ignored uncategorized debug commands. Will this version error out?
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.
To: Sietse, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
More information about the Mercurial-devel