[PATCH] ui: add new config flag for interface selection
Yuya Nishihara
yuya at tcha.org
Sat Jan 2 09:01:41 UTC 2016
On Fri, 1 Jan 2016 11:45:55 -0500, timeless wrote:
> Yuya Nishihara wrote:
> > On Tue, 22 Dec 2015 21:30:11 -0800, Laurent Charignon wrote:
> >> + # Default interface
> >> + defaultinterface = "text"
> >> + i = self.config("ui", "interface", None)
> >> + if i is not None:
> >> + if i not in alloweddefaultinterfaces:
> >> + raise error.Abort(("Unknown interface requested %s") % i)
> >
> > _("unknown interface requested %s")
> >
> >> + else:
> >> + defaultinterface = i
> >> +
> >> + # Feature-specific interface
> >> + if feature not in ("chunkselector"):
> >
> > ("chunkselector",)
> >
> >> + raise error.Abort(("Unknown feature requested %s") % feature)
> >
> > Unknown "feature" is an implementation bug. Perhaps it should raise ValueError
> > or something.
>
> No, it should be a warning.
> If we later get a "foo-chunkselector", and I like it, and I prefer it
> in my hgrc, but then I occasionally run an older hg that doesn't have
> foo-chunkselector, my hg instance should not Abort or Error, just
> warn.
In that case, the default interface would be returned.
I meant ui.interface('unknown_feature') should raise ValueError rather than
Abort because wrong argument would be passed.
More information about the Mercurial-devel
mailing list