Page MenuHomePhabricator

context: remove unnecessary default values for matchers (API)
ClosedPublic

Authored by martinvonz on Aug 23 2017, 12:35 PM.

Details

Summary

ctx._dirstatestatus() is called only from workingctx._buildstatus()
and that function, in turn, is called only from
basectx.status(). basectx.status() will always pass a matcher to
_buildstatus(), so there's no need to handle a None matcher there.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

martinvonz created this revision.Aug 23 2017, 12:35 PM
dsp requested changes to this revision.Aug 24 2017, 1:05 AM
dsp added a subscriber: dsp.

if match can't be None, then we should remove it as the default value. Otherwise I look at this in a year and think "why do we not handle a None matcher, when it clearly can be None if the value for match is not set".

This revision now requires changes to proceed.Aug 24 2017, 1:05 AM
martinvonz edited edge metadata.Aug 24 2017, 1:08 AM
martinvonz updated this revision to Diff 1243.
In D492#7991, @dsp wrote:

if match can't be None, then we should remove it as the default value. Otherwise I look at this in a year and think "why do we not handle a None matcher, when it clearly can be None if the value for match is not set".

Definitely. Good catch.

This revision was automatically updated to reflect the committed changes.