This is an archive of the discontinued Mercurial Phabricator instance.

pushvars: do not mangle repo state
ClosedPublic

Authored by quark on Aug 16 2017, 6:54 PM.

Details

Summary

Setting repo._shellvars works but is not a clean way to pass the pushvars
information from the push command to the exchange operation. Therefore
change it to actually pass pushvars as a push operation argument instead.

This makes third party extension like remotenames easier to support pushvars
cleanly. The key value parsing and verification code has been moved to a
lower level so it's harder to be bypassed and easier to be used in
remotenames which could replace push command entirely.

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

quark created this revision.Aug 16 2017, 6:54 PM
dsp added a subscriber: dsp.Aug 16 2017, 11:28 PM

this looks good to me. One consideration that users would get warnings about pushvars parsing failing fairly late now, compared to directly before we attempt a push. This can be annoying if searching for changes takes a long time. We could attempt to test if they are parsable in commands.py to avoid this.

dsp accepted this revision.Aug 16 2017, 11:28 PM
ryanmce accepted this revision.Aug 21 2017, 10:35 AM
ryanmce added a subscriber: ryanmce.

It would be really nice to get this change in.

durin42 accepted this revision.Aug 23 2017, 11:50 AM
This revision is now accepted and ready to land.Aug 23 2017, 11:50 AM
This revision was automatically updated to reflect the committed changes.