[PATCH] dispatch: do not construct repo for chgserver

Yuya Nishihara yuya at tcha.org
Fri Feb 19 10:10:22 EST 2016


On Fri, 19 Feb 2016 14:46:14 +0000, Jun Wu wrote:
> On 02/19/2016 02:27 PM, Yuya Nishihara wrote:
> > Uh. If this is the only way to go, I would rather add a copy of
> > "serve" command, say "debugchgserve", and set it to "norepo" and
> > (new) "nowarnrepo".
> 
> That's "alternative 2" in my previous mail ;)

Yes.

> Is it worth adding a new top level command? From the users' perspective
> the commands are not that different.

Well, my opinion is that it isn't worth messing up _dispatch().

> Since this is internal implementation detail, I would hide it from end
> users. i.e. it's impossible for an end user to abuse it.
> 
> And I think it's valid for a power user to start a chg server manually.
> So probably just make "hg serve" work as expected.

Maybe we could change 'norepo' to a callable.

I have patches that will replace 'dispatch.norepo' list by 'func.norepo'
boolean. It could be

norepo =
   | boolean
   | callable(ui, *args, **opts) -> boolean

or

needsrepo =
   | no
   | yes
   | optional
   | callable(ui, *args, **opts) -> no|yes|optional


More information about the Mercurial-devel mailing list