This is an archive of the discontinued Mercurial Phabricator instance.

tweakdefaults: explicitly enable/disable single colon warning
ClosedPublic

Authored by ryanmce on Sep 25 2017, 5:31 AM.
Tags
None
Subscribers

Details

Summary

I think this is a better way of surfacing this warning. It also allows
us to tweak the message so we can point at new documentation I have already
written up.

Test Plan

Updated test

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Branch
default
Lint
Lint OK
Unit
Unit Tests OK

Event Timeline

ryanmce created this revision.Sep 25 2017, 5:31 AM
mbthomas accepted this revision.Sep 25 2017, 2:41 PM
This revision is now accepted and ready to land.Sep 25 2017, 2:41 PM
mbthomas added inline comments.Sep 25 2017, 2:43 PM
hgext3rd/tweakdefaults.py
712–713

You should add a test for setting this option.

durham accepted this revision.Sep 26 2017, 7:46 AM
singhsrb requested changes to this revision.

In my opinion, _analyzewrapper can be extended to do additional analysis over the analysis it does right now. So, I prefer having develwarn config option as in D802 which disables all the analysis. It also seems fine to have both the config options: develwarn and singlecolonwarn.

tests/test-tweakdefaults.t
1

This is bad use for test cases since only a portion of the test is executed conditionally and the rest of the test is executed twice leading to a lot of redundancy. I added the test cases in D802 without realizing this and therefore, fixed this in D814. I think for the testing (as confirmed by @quark):

  • We can either split this into a separate test for developer warnings and then use the testcases approach.
  • Or, use the '--config' flag as used in D814.
This revision now requires changes to proceed.Sep 26 2017, 1:44 PM
quark added a comment.Sep 26 2017, 2:31 PM

I think the : warning is mainly for users, not (Mercurial) developers. So I prefer the explicit singlecolonwarn name. It also feels more consistent with other tweakdefaults config options.

There is a devel.all-warnings config in core Mercurial which is for developer warnings.

It seems someone has to handle some merge conflicts. It seems easier practically to apply D814 first, then do a replace and run run-tests.py -i.

quark updated this revision to Diff 2093.Sep 26 2017, 5:01 PM
quark added a comment.Sep 26 2017, 5:03 PM

@ryanmce, @singhsrb I have pushed D814 and updated this diff. Let me know if this looks better.

singhsrb accepted this revision.Sep 26 2017, 5:07 PM

Ahh, I wasn't aware of devel.all-warnings. Thanks for taking care of the merge!

This revision is now accepted and ready to land.Sep 26 2017, 5:07 PM

This is what I was about to do. Thanks for taking care of it for me @quark!

ryanmce updated this revision to Diff 2116.Sep 27 2017, 8:50 AM

add test

This revision was automatically updated to reflect the committed changes.