[PATCH V2] chgserver: set sys.argv to improve compatibility

Jun Wu quark at fb.com
Thu May 5 08:42:12 EDT 2016


On 05/05/2016 04:27 AM, Augie Fackler wrote:
> What extensions read sys.argv? I'm having trouble figuring out why one
> would even do that...

Currently the known extensions are:

1. mutable-history/hgext/evolve.py (special handling 'debugobsconvert')
2. fb-hgext/reflog.py (writing command line to reflog)

It's painful because the extension has no way to read args from ui or repo
object. Ideally we will have some API to expose dispatch.request. Otherwise
extensions have to hook dispatch or ui.log to get the information. I will fix
fb-hgext/reflog.py in this way.

At the sprint, Yuya mentioned the idea to pass down full arguments from
dispatch.py. It's a part of a very complex plan to avoid constructing repo
object during chgserver startup. The whole plan is too complex and does not
worth the effort imo.

If we have to solve the sys.argv issue, I would prefer a straightforward and
simple way like putting the information directly in the ui object.


More information about the Mercurial-devel mailing list