This is an archive of the discontinued Mercurial Phabricator instance.

hg: let extensions call the func without populating opts keys
ClosedPublic

Authored by khanchi97 on Oct 8 2021, 7:33 AM.

Details

Summary

This change is to help extensions by not forcing them to populate with
opts[b'bundle'] and opts[b'force'] when calling hg.incoming(...)

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

khanchi97 created this revision.Oct 8 2021, 7:33 AM
martinvonz requested changes to this revision.Oct 8 2021, 4:45 PM
martinvonz added a subscriber: martinvonz.

This needs a clearer commit message. I *think* what you mean is that you're doing this in order to let extensions call these functions without populating the opts[b"bundle"] etc. However, does your extension really want to call debugbackupbundle()? Or do the KeyErrors actually happen when you simply run some hg commands? Which ones?

This revision now requires changes to proceed.Oct 8 2021, 4:45 PM

This needs a clearer commit message. I *think* what you mean is that you're doing this in order to let extensions call these functions without populating the opts[b"bundle"] etc.

Yes. I will change the commit message.

However, does your extension really want to call debugbackupbundle()?

No. The extension don't intend to call debugbackupbundle(). I just thought it's no harm to make the change here as well. I'll undo it.

khanchi97 retitled this revision from hg: use dict.get() instead, to prevent KeyError to hg: let extensions call the func without populating opts keys.Oct 9 2021, 12:25 AM
khanchi97 edited the summary of this revision. (Show Details)
khanchi97 updated this revision to Diff 30697.
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.