This is an archive of the discontinued Mercurial Phabricator instance.

tests: conditionalize return code on chg in test-config.t
ClosedPublic

Authored by pulkit on Nov 30 2020, 4:42 AM.

Details

Summary

If there is any error while reading config, chg just returns 255 instead of 30.

It seems to me that we cannot conditionalize only return codes in output using
trailing (chg !) and hence used testcases.

The test was failing with chg but after this patch, it now passes.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Nov 30 2020, 4:42 AM

Why do we have a different return code than the non-chg code ?

Why do we have a different return code than the non-chg code ?

While loading the UI, if some error happens, chg returns 255 and does not follow the return code from dispatch.*. Actually chg needs to be upgraded to fine-grained error handling and return codes as right now it's not obvious which error we are catching as we just use except error.Abort.

mharbison72 accepted this revision.Dec 1 2020, 6:35 PM
mharbison72 added a subscriber: mharbison72.

Queued 1 and 3, thanks

This revision is now accepted and ready to land.Dec 1 2020, 6:35 PM
This revision was automatically updated to reflect the committed changes.