This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa84564b1a0b1: help: check if a subtopic exists and raise an
error if it doesnt (issue6145) (authored by ngoldbaum, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
ngoldbaum updated this revision to Diff 15268.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D6441?vs=15258=15268
REVISION DETAIL
https://phab.mercurial-scm.org/D6441
AFFECTED FILES
mercurial/help.py
CHANGE DETAILS
diff --git a/mercurial/help.py
pulkit added inline comments.
INLINE COMMENTS
> ngoldbaum wrote in help.py:689-695
> OK, I agree that's clearer. I used `_` to match `header` and `doc` to make
> the line a bit shorter and to make it a bit clearer for me to read since
> those aren't being used.
This should work but we have
ngoldbaum added inline comments.
INLINE COMMENTS
> martinvonz wrote in help.py:689-695
> I avoid for-else for the same reason, but how about this:
>
> if not any(subtopic in names for names, header, doc in subtopics[name]):
> raise error.UnknownCommand(name)
OK, I agree that's clearer.
ngoldbaum updated this revision to Diff 15258.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D6441?vs=15246=15258
REVISION DETAIL
https://phab.mercurial-scm.org/D6441
AFFECTED FILES
mercurial/help.py
CHANGE DETAILS
diff --git a/mercurial/help.py
martinvonz requested changes to this revision.
martinvonz added inline comments.
This revision now requires changes to proceed.
INLINE COMMENTS
> ngoldbaum wrote in help.py:689-695
> I left this as-is because I find for-else statements hard to read (I never
> remember what it means!) and find
ngoldbaum added inline comments.
INLINE COMMENTS
> av6 wrote in help.py:689-695
> This made me remember that for-else statement exists.
I left this as-is because I find for-else statements hard to read (I never
remember what it means!) and find this to be clearer even if there's a bit more
av6 added inline comments.
INLINE COMMENTS
> help.py:689-695
> +exists = False
> for names, header, doc in subtopics[name]:
> if subtopic in names:
> +exists = True
> break
> +if not exists:
> +
ngoldbaum created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D6441
AFFECTED FILES
mercurial/help.py
CHANGE DETAILS
diff --git a/mercurial/help.py