This is an archive of the discontinued Mercurial Phabricator instance.

registrar: make cmdtype an attribute of the function in registar.command
AbandonedPublic

Authored by pulkit on Sep 2 2017, 1:39 PM.

Details

Reviewers
durham
krbullock
Group Reviewers
hg-reviewers
Summary

This patch makes the cmdtype an attribute of the func returned by
registrar.command, so that we can make decisions in dispatch.py depending upon
the type of the command. If the cmdtype is not in the possible ones, we throw a
ProgrammingError.

Currently this will be used in deciding the level of access on hidden commits a
command can have.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Sep 2 2017, 1:39 PM
durham added a subscriber: durham.Sep 7 2017, 8:51 PM
durham added inline comments.
mercurial/registrar.py
156

Should we throw an exception instead? Seems like a programmer error

pulkit planned changes to this revision.Sep 9 2017, 1:30 PM
pulkit added inline comments.
mercurial/registrar.py
156

Yes, thanks!

pulkit edited the summary of this revision. (Show Details)Sep 11 2017, 5:56 PM
pulkit updated this revision to Diff 1731.
durham accepted this revision.Sep 12 2017, 12:06 PM
pulkit abandoned this revision.Sep 13 2017, 7:34 AM
pulkit edited the summary of this revision. (Show Details)Sep 13 2017, 8:34 AM
pulkit retitled this revision from directaccess: make the hiddenlevel an attribute of the function to registrar: make cmdtype an attribute of the function in registar.command.
pulkit updated this revision to Diff 1779.
durin42 added inline comments.
mercurial/dispatch.py
491

Shouldn't this reference the constant from the enum class?

krbullock requested changes to this revision.Sep 18 2017, 3:53 PM
krbullock added a subscriber: krbullock.

Flagging for revision per Augie's open question.

This revision now requires changes to proceed.Sep 18 2017, 3:53 PM
pulkit abandoned this revision.Sep 19 2017, 9:38 PM

Send as D736, D737 and D738.