tests/test-server-view.t
author Joerg Sonnenberger <joerg@bec.de>
Tue, 12 Feb 2019 19:08:17 +0100
changeset 41840 d6569f1e9b37
child 42106 bcf59ddc6173
permissions -rw-r--r--
server: allow customizing the default repo filter hgweb has the (undocument) configuration option web.view that allows restricting visible revisions to immutable. This is useful for serving the same storage as publishing and non-publishing repo. Add the new server.view option to serve the same purpose by changing the default behavior of `getdispatchrepo`. Drop the hard-coded 'served' filter in the batch handler of v1 of the wire proto, this is a left-over from the days before `getdispatchrepo` existed. Differential Revision: https://phab.mercurial-scm.org/D5946

  $ hg init test
  $ cd test
  $ hg debugbuilddag '+2'
  $ hg phase --public 0

  $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
  $ cat hg.pid >> $DAEMON_PIDS
  $ cd ..
  $ hg init test2
  $ cd test2
  $ hg incoming http://foo:xyzzy@localhost:$HGPORT/
  comparing with http://foo:***@localhost:$HGPORT/
  changeset:   0:1ea73414a91b
  user:        debugbuilddag
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     r0
  
  changeset:   1:66f7d451a68b
  tag:         tip
  user:        debugbuilddag
  date:        Thu Jan 01 00:00:01 1970 +0000
  summary:     r1
  
  $ killdaemons.py

  $ cd ../test
  $ hg --config server.view=immutable serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
  $ cat hg.pid >> $DAEMON_PIDS
  $ cd ../test2
  $ hg incoming http://foo:xyzzy@localhost:$HGPORT/
  comparing with http://foo:***@localhost:$HGPORT/
  changeset:   0:1ea73414a91b
  tag:         tip
  user:        debugbuilddag
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     r0
  
  $ killdaemons.py