martinvonz added inline comments.

INLINE COMMENTS

> gendoc.py:198-207
> +    for cmd in cmds:
> +        try:
> +            cmdsbycategory[helpcategory(cmd)].append(cmd)
> +        except KeyError:
> +            # If a command category wasn't registered, the command won't get
> +            # rendered below, so we raise an AssertionError.
> +            raise AssertionError(

No need to use exceptions here (`KeyError` could potentially be raised by 
something we didn't expect and then we'd misdiagnose it here). I think it's 
clearer like this:

  category = helpcategory(cmd)
  if category in cmdsbycategory:
      raise ...
  cmdsbycategory[category].append(cmd)

> gendoc.py:200
> +        try:
> +            cmdsbycategory[helpcategory(cmd)].append(cmd)
> +        except KeyError:

I think a previous version of this patch ignored uncategorized debug commands. 
Will this version error out?

REPOSITORY
  rHG Mercurial

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

To: Sietse, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to