This is an archive of the discontinued Mercurial Phabricator instance.

config: graduate experimental.updatecheck to commands.update.check
ClosedPublic

Authored by durin42 on Oct 14 2017, 3:15 AM.

Details

Summary

.. feature::

New `commands.update.check` feature to adjust constraints on when
`hg update` will allow updates with a dirty working copy.

also

.. bc::

The `experimental.updatecheck` name for the new `commands.update.check`
feature is now deprecated, and will be removed after this release.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Oct 14 2017, 3:15 AM
morisgi added inline comments.
mercurial/configitems.py
182

Should it be documented in the help then?

lothiraldan requested changes to this revision.Oct 14 2017, 11:45 AM
lothiraldan added a subscriber: lothiraldan.

Could you add an alias to experimental.updatecheck so old configurations will not break. I'm not saying to keep it forever but at least have it when we change it.

+1 on documenting the option now that it's not experimental anymore

This revision now requires changes to proceed.Oct 14 2017, 11:45 AM
durin42 edited the summary of this revision. (Show Details)Oct 14 2017, 4:33 PM
durin42 updated this revision to Diff 2745.
durin42 marked an inline comment as done.Oct 14 2017, 4:40 PM

Added some docs.

Could you add an alias to experimental.updatecheck so old configurations will not break. I'm not saying to keep it forever but at least have it when we change it.
+1 on documenting the option now that it's not experimental anymore

Done.

indygreg accepted this revision.Oct 14 2017, 4:48 PM
indygreg added a subscriber: indygreg.

I'm not crazy about the code style. But since this code only lives for a release, I'm OK taking it. I'll accept this but will defer to someone else to queue it in case there are strong opinions about the style.

mercurial/hg.py
764–767

How do you feel about this alternative approach?

updatecheck = ui.config('commands', 'update.check')
if updatecheck is None:
    updatecheck = ui.config('experimental', 'updatecheck')
if updatecheck not in ('abort', ...):
    updatecheck = 'linear'
durin42 updated this revision to Diff 2749.Oct 14 2017, 4:50 PM
durin42 added inline comments.Oct 14 2017, 4:50 PM
mercurial/hg.py
764–767

Sure, that seems strictly better. Done.

indygreg accepted this revision.Oct 14 2017, 5:25 PM
This revision was automatically updated to reflect the committed changes.

Sorry, I was not clear, I was thinking about adding an alias in the config registration, like that:

coreconfigitem('commands', 'update.check',
    default=None,
    alias=[('experimental', 'updatecheck')]
)

Should I send a follow-up?

Ugh, please send a follow-up, sorry about that.