Disable hgweb browsing

marcinkuzminski marcinkuz at gmail.com
Wed Jun 8 10:23:11 CDT 2011

I think what you need is to use the build in wsgi app server that
hgweb runs on, and wrap it around your web app.
This is what I did in rhodecode, building the web interface from

Here's what i did starting developing rhodecode

Similar code (since hgwebdir is deprecated) should do the job.


On May 30, 10:03 am, moroswitie <moroswi... at gmail.com> wrote:
> moroswitie &lt;moroswi... at gmail.com&gt; writes:
> > I'm currently starting to work on a custom mercurial project web
> > application and need to disable the build in repository browser.
> > I wasn't able to find such an option, and a quick work around would be
> > to redirect all repository browser requests. The problemd is I
> > couldn't find the format that the hgweb.cgi scripts accepts to show
> > the repository browser.
> Try running 'hg serve' and accesshttp://localhost:8000/in your
> browser. Now access it with hg, the command line client.
> If people want to browse their local copy of the repository that isn't a
> problem.
> Martin Geisler wrote:
> >> Could anybody point me in the right direction so I know how to rewrite
> >> the request so that I can serve up a nice error message saying that
> >> repository browsing is disabled with the build in browser.
> >> Disabling the browser should not disable pull or push. So I think I
> >> also need to know the urls for the push and pull commands.
> > If people can pull, then they can just run 'hg serve' locally and do
> > what you are trying to disable... so why do you want to disable the
> > repository browser on your server?
> > All the commands done by the command line client access URLs of the form
> >   /?cmd=COMMAND
> We are setting up multiple repositories and are creating a custom repository
> browser. To avoid confusion we would like to disable the build in browser.
> By making use of the webserver, we are able to allow/disallow pull/push
> actions based on the username and password. Some developers are not able to
> make use of ssh all the time so we are looking for a solution to do this
> with http, and could only find the hgweb.cgi script to do this. If there are
> other ways of allowing push/pull over http/https that would make things even
> easier. I hope that explains it a little better.
> --
> View this message in context:http://mercurial.808500.n3.nabble.com/Disable-hgweb-browsing-tp300107...
> Sent from the General mailing list archive at Nabble.com.
> _______________________________________________
> Mercurial mailing list
> Mercur... at selenic.comhttp://selenic.com/mailman/listinfo/mercurial

More information about the Mercurial mailing list